【问题标题】:Remove space between menu icon and title删除菜单图标和标题之间的空格
【发布时间】:2017-10-20 14:26:33
【问题描述】:

在下图中,如何删除菜单中图标和项目标题之间的空格?

activity_main_drawer.xml:

<?xml version="1.0" encoding="utf-8" ?>
<menu xmlns:android="http://schemas.android.com/apk/res/android">
    <item
        android:icon="@drawable/ic_exit_to_app"
        android:id="@+id/logout"
        android:title="Logout" />
</menu>

styles.xml:

<?xml version="1.0" encoding="utf-8" ?>
<resources>
    <style name="AppTheme" parent="Theme.AppCompat.Light">
        <item name="colorPrimary">@color/colorPrimary</item>
        <item name="colorPrimaryDark">@color/colorPrimaryDark</item>
        <item name="colorAccent">@color/colorAccent</item>
    </style>
    <style name="AppTheme.AppBarOverlay" parent="ThemeOverlay.AppCompat.Dark.ActionBar" />
    <style name="AppTheme.LoginButton" />
    <style name="AppTheme.NoActionBar" parent="AppTheme">
        <item name="windowActionBar">false</item>
        <item name="windowNoTitle">true</item>
    </style>
    <style name="AppTheme.PopupOverlay" parent="ThemeOverlay.AppCompat.Light" />
</resources>

【问题讨论】:

标签: android xml android-layout android-view android-resources


【解决方案1】:

您可以在 dimens.xml 中使用那些覆盖 these 值的值:

<dimen name="design_navigation_icon_padding" tools:override="true">10dp</dimen>

但是,违反材料设计准则是不可取的。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2018-02-18
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2020-09-30
    • 1970-01-01
    相关资源
    最近更新 更多