当我在播放视频时滚动 Horizontal RecyclerView
时,videoView
的边缘会显示壁纸。
我尝试了vieoView
、ExoPlayer
、surfaceView
。但所有这些都显示出同样的问题。当 videoView
替换为 imageView
时,问题就可以解决。
<hu.lacroix82.stretchtopviewlibrary.StretchTopScrollView
xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/stretchTopView"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_marginBottom="150dp"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools">
<LinearLayout
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="match_parent">
<android.support.constraint.ConstraintLayout
android:id="@+id/cl_root"
android:layout_width="match_parent"
android:layout_height="400dp"
android:background="@color/background_main">
<VideoView
android:id="@+id/video_view"
android:layout_width="match_parent"
android:layout_height="wrap_content"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintTop_toTopOf="parent" />
......
.......
.......
最佳答案
首先,检查您用于此 Activity 的主题。是否是透明主题?因为您尝试了多个视频播放库并且出现了同样的问题,所以我认为这不是编码方面的问题。这必须来自您的 Activity 主题,因此将您的 Activity 主题更改为纯色的深色主题。让我知道问题是否解决?
关于android - 水平 RecyclerView 中的 VideoView 在滑动时显示壁纸,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/57068789/