问题 : NavigationView 不显示菜单项的全文,也不截断文本。
这个项目我没看错——两个字“小标题”:
<item
android:id="@+id/example1"
android:icon="@drawable/filter_2"
android:title="Small title"
android:checked="false"
app:actionLayout="@layout/menu_counter" />
/>
和下一个项目 - 我只看到前两个词“小标题”没有下一个词“andveryverylongword”的任何截断:
<item
android:id="@+id/example2"
android:icon="@drawable/filter_2"
android:title="Small title andveryverylongword"
android:checked="false"
app:actionLayout="@layout/menu_counter" />
/>
小部件:
<android.support.design.widget.NavigationView
android:id="@+id/nav_view"
ndroid: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"/>
另外:AndroidStudio 1.5,支持库。
编辑:
这是 Android Studio 中标准项目“抽屉导航事件”的示例。
activity_main_drawer.xml :
在移动:
最佳答案
我刚开始工作
* 覆盖 design_navigation_item.xml 并将其更改为使用
android:layout_height="wrap_content"
android:minHeight="?android:listPreferredItemHeightSmall"
有点酷,我不敢相信这有效。感谢 stackoverflow 上谈论覆盖图标大小的人,这帮助我朝这个方向思考。
关于android-support-library - 安卓导航 View : not show full item and not truncate,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/35600267/