2
問題:NavigationView 沒有顯示菜單項的全文,也不會截斷文本。的Android 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" />
/>
的Widget:
<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中標準項目「導航抽屜活動」的示例。
我有類似的問題在http://stackoverflow.com/questions/36157300/how-to-set-ellipsize-in-menu-item-of-navigationview中描述。您能提供有關覆蓋design_navigation_menu_item.xml的更多信息嗎? –
@AleksanderMielczarek基本上只需將文件中的代碼複製並粘貼到/usr/local/google/buildbot/src/googleplex-android/mnc-supportlib-release/frameworks/support/design/res/layout/design_navigation_menu_item.xml中您在/ rest/layout目錄中創建design_navigation_menu_item.xml,然後修改所需的內容。根據需要拼寫源代碼,以查看是否需要覆蓋子標頭或其他任何子標頭。我仍然沒有弄清楚這個複合物是否可繪製,如果它可以像一個子彈點而不是中心那樣排列在左上方。 – nAndroid