menu - Android Navigation Drawer not showing SOME items -
my problem pretty awkard: have menu used in navigationview
. problem in preview , in running application, items in menu
, items in drawer different.
this menu activity_main_drawer
<?xml version="1.0" encoding="utf-8"?> <menu xmlns:android="http://schemas.android.com/apk/res/android"> <group> <item android:visible="true" android:id="@+id/navitemhomepage" android:icon="@drawable/ic_home" android:title="home" /> </group> <item android:id="@+id/navmenuinterventions" android:visible="true" android:title="interventi"> <menu> <item android:id="@+id/navitemmyinterventions" android:icon="@drawable/ic_interventions" android:title="miei" /> <item android:id="@+id/navitemunplannedint" android:icon="@drawable/ic_unplanned" android:title="non pianificati" /> <item android:id="@+id/navitemassign" android:icon="@drawable/ic_assign" android:title="assegna" /> <item android:id="@+id/navitemvalidate" android:icon="@drawable/ic_check" android:title="valida" /> <item android:id="@+id/navitemnewodl" android:icon="@drawable/ic_add" android:title="nuovo odl" /> </menu> </item> <item android:id="@+id/navmenuwarehouse" android:visible="true" android:title="magazzino"> <menu> <item android:id="@+id/navitemstocks" android:icon="@drawable/ic_warehouse" android:title="giacenze" /> <item android:id="@+id/navitemcharge" android:icon="@drawable/ic_load" android:title="carica materiali" /> <item android:id="@+id/navitemuncharge" android:icon="@drawable/ic_unload" android:title="scarica materiali" /> </menu> </item> <item android:id="@+id/navmenusync" android:visible="true" android:title="sincronizzazioni"> <menu> <item android:id="@+id/navitemsync" android:icon="@drawable/ic_sync" android:title="sincronizza anagrafiche" /> <!--<item--> <!--android:id="@+id/navitemsync"--> <!--android:title="sincronizza interventi"/>--> </menu> </item> <item android:id="@+id/navmenualerts" android:visible="true" android:title="avvisi"> <menu> <item android:id="@+id/navitemalerts" android:icon="@drawable/ic_alert" android:title="avvisi" /> <item android:id="@+id/navitemnewalert" android:icon="@drawable/ic_add" android:title="nuovo avviso" /> </menu> </item> <item android:id="@+id/navmenutimbs" android:visible="true" android:title="timbrature"> <menu> <item android:id="@+id/navitemtimbs" android:icon="@drawable/ic_timb" android:title="timbrature" /> </menu> </item> <item android:id="@+id/navmenuother" android:visible="true" android:title="altro"> <menu> <item android:id="@+id/navitemsettings" android:icon="@drawable/ic_settings" android:title="impostazioni" /> <item android:id="@+id/navitemlogout" android:icon="@drawable/ic_logout" android:title="logout" /> </menu> </item> </menu>
and use in main activity navigation drawer
.
by using preview in menu file, can see correctly information can see below (sorry italian titles):
and main activity
code (with navigationview
)
<?xml version="1.0" encoding="utf-8"?> <android.support.v4.widget.drawerlayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:app="http://schemas.android.com/apk/res-auto" xmlns:tools="http://schemas.android.com/tools" android:background="@drawable/background_light_grey" android:id="@+id/drawer_layout" android:layout_width="match_parent" android:layout_height="match_parent" android:fitssystemwindows="true" tools:opendrawer="start"> <view android:layout_width="0dp" android:layout_height="0dp" android:focusable="true" android:focusableintouchmode="true" /> <include layout="@layout/app_bar_main" android:layout_width="match_parent" android:layout_height="match_parent" app:layout_behavior="@string/appbar_scrolling_view_behavior" /> <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" /> </android.support.v4.widget.drawerlayout>
but, when using preview, see (it misses "magazzini" , "avvisi" menus)
and in running application don't see both "magazzini" , "avvisi" menues.
anyone has idea why 2 menues not visible in application? copy-pasted each other don't why preview hiding 2 of them.
thanks
Comments
Post a Comment