Remove scrollbar from android support design navigation drawer?
You can also use following style in your style.xml
<item name="android:scrollbarThumbVertical">@color/transparent</item>
if you don't have a transparent color defined in colors.xml, use the android library "transparent" with: <item name="android:scrollbarThumbVertical">@android:color/transparent</item>
Unfortunately the scrollbar is set in the NavigationMenuView
layout not in the NavigationView
, for this reason if you use android:scrollbars="none"
the scrollbar is still present.
You can do it programmatically calling this method:
private void disableNavigationViewScrollbars(NavigationView navigationView) {
if (navigationView != null) {
NavigationMenuView navigationMenuView = (NavigationMenuView) navigationView.getChildAt(0);
if (navigationMenuView != null) {
navigationMenuView.setVerticalScrollBarEnabled(false);
}
}
}