首先你要做的是定义的高度和宽度
ImageButton
wrap_content
所以它可以正常工作。
播放按钮上方的填充是由于缺少高度和宽度
app:touch_target_height
这个高度增加了播放按钮和时间之间的间隔酒吧。这个高度是内栏的触摸区域,你可以用它来增加用户的触摸区域而不增加栏的大小,这看起来像是填充。制造尺寸
0dp
填充物就会消失
还有一个填充是图像填充。我从
exoPlayer
我发现这个图像也有一些默认的填充。如果你想删除这个填充,然后改变这个图像。
也可以使用
app:bar_height
但是记住
应用:酒吧高度
不能交叉
应用程序:触摸目标高度
. 即使你给它下了更多的定义
#9e0c26
)
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="match_parent">
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="bottom"
android:background="#CC000000"
android:layoutDirection="ltr"
android:orientation="vertical">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="center"
android:orientation="horizontal">
<ImageButton
android:id="@id/exo_play"
style="@style/ExoMediaButton.Play"
android:layout_width="wrap_content"
android:layout_height="wrap_content" />
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="center_vertical"
android:orientation="horizontal">
<com.google.android.exoplayer2.ui.DefaultTimeBar
android:id="@id/exo_progress"
android:layout_width="match_parent"
android:layout_height="wrap_content"
app:bar_height="2dp"
app:touch_target_height="2dp" />
</LinearLayout>
</LinearLayout>