问题描述
我在VideoView
和ViewPager
刷卡动作上遇到问题.刷卡时,我可以在VideoView
的右侧或左侧看到黑线(取决于刷卡的一侧).我该如何处理.
I have a problem with VideoView
and ViewPager
swiping action. While swiping I can see black lines on the right or left side of VideoView
(depends on side of swiping) . How can I deal with this.
使用FragmentStatePagerAdapter
和ViewPager
完成.父级Activity
的SurfaceView
具有0px
宽度和高度,并且已设置getWindow( ).setFormat( PixelFormat.TRANSLUCENT );
我要从JAVA
代码中添加VideoView
.
It was done using FragmentStatePagerAdapter
and ViewPager
. Parent Activity
has SurfaceView
with 0px
width and height and setgetWindow( ).setFormat( PixelFormat.TRANSLUCENT );
I'm adding VideoView
from JAVA
code.
推荐答案
VideoView基于Surfaceview,对于翻译和其他行为而言不是很理想.并且更适合静态布局的全屏视频播放器.您正在寻找的是基于textureview的videoview.尝试在github上搜索库.
VideoView is based of Surfaceview which is not very ideal for translation and other behaviours. and much more suited to full screen video players that are static in layout. What you are looking for is textureview based videoview. Try searching library on github.
这篇关于滑动时VideoView ViewPager黑色线条的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!