本文介绍了滑动时VideoView ViewPager黑色线条的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在VideoViewViewPager刷卡动作上遇到问题.刷卡时,我可以在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.

使用FragmentStatePagerAdapterViewPager完成.父级ActivitySurfaceView具有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黑色线条的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-27 03:15