小编Dar*_*ryh的帖子

StylePlayerView 控制器 xml 覆盖播放和暂停按钮不起作用

我更新了我的项目 exoplayer 依赖项,并且我正在使用 StylePlayerView (来自 exoplayer 的自定义布局)参考更新我的代码,但是当我执行代码时,关于这 2 个按钮“播放”和“暂停”的高估不起作用,您使用 PLAY_PAUSE 并有效,但是我想自定义这个图标..所以如果有人可以帮助我,我真的很感激。psdt.-对我的英语感到抱歉,因为我说西班牙语。

<?xml version="1.0" encoding="utf-8"?>
<com.google.android.exoplayer2.ui.AspectRatioFrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    xmlns:tools="http://schemas.android.com/tools"
    android:id="@+id/customized_controller"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:layout_gravity="center_horizontal"
    android:background="@color/transparentBackground">

    <androidx.constraintlayout.widget.ConstraintLayout
        android:layout_width="match_parent"
        android:layout_height="match_parent">

        <LinearLayout
            android:id="@+id/linearLayout"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:orientation="horizontal"
            app:layout_constraintBottom_toBottomOf="parent"
            app:layout_constraintEnd_toEndOf="parent"
            app:layout_constraintStart_toStartOf="parent"
            app:layout_constraintTop_toTopOf="parent">

            <ImageButton
                android:id="@+id/exo_rew"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:contentDescription="@string/replay"
                android:layout_gravity="center"
                style="@style/ExoMediaButton.Rewind"
                android:src="@drawable/ic_replay_10" />

            <ImageButton
                android:id="@+id/exo_play_pause"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:contentDescription="@string/play"
                android:visibility="gone"
                android:layout_gravity="center"
                style="@style/ExoMediaButton.Play"
                android:src="@drawable/ic_play"/>

            <ImageButton
                android:id="@+id/exo_play"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:contentDescription="@string/play"
                android:layout_gravity="center"
                android:visibility="visible"
                style="@style/ExoMediaButton.Play"
                android:src="@drawable/ic_play"/>

            <ImageButton
                android:id="@+id/exo_pause"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:contentDescription="@string/pause"
                android:layout_gravity="center"
                android:visibility="visible"
                style="@style/ExoMediaButton.Pause"
                android:src="@drawable/ic_pause" />

            <ImageButton
                android:id="@+id/exo_ffwd"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:contentDescription="@string/fast_forward"
                android:layout_gravity="center"
                style="@style/ExoMediaButton.FastForward"
                android:src="@drawable/ic_forward_30" …
Run Code Online (Sandbox Code Playgroud)

xml android android-layout exoplayer

4
推荐指数
1
解决办法
1016
查看次数

标签 统计

android ×1

android-layout ×1

exoplayer ×1

xml ×1