gpt4 book ai didi

android - 如何为抽屉导航菜单项设置多行?

转载 作者:行者123 更新时间:2023-11-29 14:18:00 24 4
gpt4 key购买 nike

如何为抽屉导航中的菜单项设置多行(如果项目的文本不适合抽屉导航宽度?

最佳答案

组合答案https://stackoverflow.com/a/40575681/10824768评论找到了一个简单的解决方案

  • Add a new style to the styles.xml
  • Set the new style to the NavigationView

res / values / styles.xml

<style name="TextAppearance">
<item name="android:lines">2</item>
</style>

res / layout / activity_main.xml

<android.support.design.widget.NavigationView
android:id="@+id/nav_view"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_gravity="start"
android:fitsSystemWindows="true"
app:headerLayout="@layout/nav_header_main"
app:menu="@menu/activity_main_drawer"
app:theme="@style/TextAppearance" />

关于android - 如何为抽屉导航菜单项设置多行?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/40379145/

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