gpt4 book ai didi

android - 减少工具栏上导航图标和 Logo 之间的填充

转载 作者:太空宇宙 更新时间:2023-11-03 11:31:41 25 4
gpt4 key购买 nike

有谁知道如何减少工具栏上导航图标和 Logo 之间的填充。出于某种原因,它们之间的空间似乎比我的 Logo 和标题之间的空间大。

我已经尝试添加样式并使用 contentInset,但它们似乎都不起作用。

我的布局

<android.support.v7.widget.Toolbar
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="wrap_content"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:background="@color/background_grey"
android:style="@style/ToolbarTheme"
android:contentInsetLeft="0dp"
android:contentInsetStart="0dp"
app:logo="@drawable/ic_launcher">

</android.support.v7.widget.Toolbar>

我的风格

<style name="ToolbarTheme" parent="Theme.AppCompat">
<item name="android:minWidth">0dip</item>
<item name="android:paddingLeft">0dip</item>
<item name="android:paddingRight">0dip</item>
</style>

Image (Space indicated by red lines should be smaller)

最佳答案

如果您只对减少工具栏上导航图标和 Logo 之间的填充感兴趣,请使用Toolbar.setContentInsetStartWithNavigation(0)

Unlike contentInsetStart, this will modify the inset only when there is a Navigation Icon. In the absence of the Navigation Icon, you will still have the 16dp start inset.

关于android - 减少工具栏上导航图标和 Logo 之间的填充,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/33263589/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com