android - 水平 RecyclerView 中的 VideoView 在滑动时显示壁纸

标签 android android-recyclerview android-videoview

当我在播放视频时滚动 Horizo​​ntal RecyclerView 时,videoView 的边缘会显示壁纸。

Screenshot of error

我尝试了vieoViewExoPlayersurfaceView。但所有这些都显示出同样的问题。当 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/

相关文章:

java - 如何强制将应用程序附加到android market?

android - 使用私有(private)样式(找不到与给定名称匹配的资源)

android - 在 Fragment(回收器 View )上调用 setAdapter 不起作用

java - 如何使用 ViewModel 将数据加载到 fragment 内的 RecyclerView 中

java - [Java]Android Videoview 只能处理本地文件

android - 修复了在 native 中滚动时的导航栏

java - 安卓框架?

java - FireStore 数据未显示正在访问隐藏方法 Lsun/misc/Unsafe;->putLong(Ljava/lang/Object;JJ)V(灰名单、链接、允许)

Android视频多次播放后停止播放错误1,2147483648

android - VideoView 变量有错误的值