如何为抽屉导航中的菜单项设置多行(如果项目的文本不适合抽屉导航宽度?
最佳答案
组合答案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/