gpt4 book ai didi

android - 更改默认抽屉导航的图标大小

转载 作者:行者123 更新时间:2023-12-04 14:36:10 27 4
gpt4 key购买 nike

尝试更改默认抽屉导航的图标大小,并在每个项目后添加一个分隔线,但我不明白该怎么做?这是菜单抽屉 View :


<group android:checkableBehavior="single">
<item
android:id="@+id/agenda"
android:icon="@drawable/agenda"
android:title="AGENDA"
/>
<item
android:id="@+id/speakers"
android:icon="@drawable/speakers"
android:title="SPEAKERS" />
<item
android:id="@+id/schedule"
android:icon="@drawable/schedule"
android:title="SCHEDULE" />
<item
android:id="@+id/organiser"
android:icon="@drawable/organiser"
android:title="ORGANISER" />
<item
android:id="@+id/partners"
android:icon="@drawable/partner"
android:title="PARTNERS" />
<item
android:id="@+id/event_info"
android:icon="@drawable/eventinfo"
android:title="EVENT-INFO" />
</group>

这是dimens.xml
<resources>
<!-- Default screen margins, per the Android Design guidelines. -->
<dimen name="activity_horizontal_margin">16dp</dimen>
<dimen name="activity_vertical_margin">16dp</dimen>
<!-- Default screen margins, per the Android Design guidelines. -->
<dimen name="nav_header_vertical_spacing">16dp</dimen>
<dimen name="nav_header_height">160dp</dimen>
</resources>

最佳答案

在 dimens.xml 中设置 design_navigation_icon_size 和 design_navigation_icon_padding 对我有用。

/values/dimens.xml

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

关于android - 更改默认抽屉导航的图标大小,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/41843548/

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