Remove Line Divider From Navigationview Android May 18, 2024 Post a Comment i have this menu for the NavigationView of layout: Solution 1: Add this to your Styles:<item name="android:listDivider">@android:color/transparent</item>CopyHere you can read more about it: How can I change separator color in NavigationView?Solution 2: I had same problem with BottomNavigationView. Maybe someone will find my solution usefull. Reason of this divider on android devices with API < 21 is this code snippet in BottomNavigationView sources: if (VERSION.SDK_INT < 21) { this.addCompatibilityTopDivider(context); } CopyaddCompatibilityTopDivider(context) method: privatevoidaddCompatibilityTopDivider(Context context) { Viewdivider=newView(context); divider.setBackgroundColor(ContextCompat.getColor(context, color.design_bottom_navigation_shadow_color)); LayoutParamsdividerParams=newLayoutParams(-1, this.getResources().getDimensionPixelSize(dimen.design_bottom_navigation_shadow_height)); divider.setLayoutParams(dividerParams); this.addView(divider); } CopyMy solution was to override design_bottom_navigation_shadow_color in colors.xml, like this: Baca JugaAndroid Navigation View TransparencyNavigation View's Selectors Behave IncorrectlyRemove Line Divider From NavigationView Android<color name="design_bottom_navigation_shadow_color" tools:override="true">#00000000</color>CopyAnd it works:)Solution 3: <groupandroid:id="@+id/menu_top"><itemandroid:title="title1"><menu><itemandroid:id="@+id/nav_tab1"android:icon="@drawable/ic_action_nav_tab1"android:title="test1" /><itemandroid:id="@+id/nav_tab2"android:icon="@drawable/ic_action_nav_tab2"android:title="test2" /></menu></item><itemandroid:title="title2"><menu><itemandroid:id="@+id/nav_settings"android:icon="@drawable/ic_action_settings"android:title="test3" /></menu></item>Copy Try grouping these items...I haven't tried this but it should work Share You may like these postsRemove Line Divider From NavigationView AndroidOpen Navigationview On Right Swipe From Everywhere On The LayoutNavigation View's Selectors Behave IncorrectlyAndroid Navigation View Transparency Post a Comment for "Remove Line Divider From Navigationview Android"
Post a Comment for "Remove Line Divider From Navigationview Android"