【发布时间】:2021-02-10 03:00:48
【问题描述】:
我正在使用导航组件 Jetpack,所以我的工具栏中会自动生成一些按钮。像这样:
但结果令人失望,代表 Burgerbutton 的 AppcompatImageButton 采用了太大的填充,如下所示:
我试过这样的方法,但是没有任何效果
<androidx.appcompat.widget.Toolbar
android:id="@+id/toolbar"
android:layout_width="match_parent"
android:layout_height="?attr/actionBarSize"
android:background="?attr/colorPrimary"
app:contentInsetStartWithNavigation="0dp"
app:contentInsetStart="0dp"
app:contentInsetLeft="0dp"
app:contentInsetEnd="0dp"
app:contentInsetRight="0dp"
app:popupTheme="@style/AppTheme.PopupOverlay">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="horizontal"
android:weightSum="5">
</LinearLayout>
</androidx.appcompat.widget.Toolbar>
如何减小填充大小?
【问题讨论】:
-
这看起来已经是 48x48dp 的最小可访问触摸尺寸了。
-
你的意思是我不能再减少填充了吗?
标签: android toolbar android-appbarlayout android-jetpack-navigation