I’ve implemented NavigationDrawer with android-support-v4 as per this tutorial
My result is on this screenshot.
The question is how to remove or configure these transparency on Drawer which looks awful with background text.
UPDATE: here is my layout configuration, with background been set to dark
<android.support.v4.widget.DrawerLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/drawer_layout"
android:layout_width="match_parent"
android:layout_height="match_parent"
>
<FrameLayout
android:id="@+id/content_frame"
android:layout_width="match_parent"
android:layout_height="match_parent"/>
<ListView
android:id="@+id/left_drawer"
android:layout_width="240dp"
android:layout_height="match_parent"
android:layout_gravity="start"
android:choiceMode="singleChoice"
android:divider="@android:color/transparent"
android:dividerHeight="0dp"
android:background="#111111"/>
</android.support.v4.widget.DrawerLayout>
navigationView. getBackground(). setAlpha(122); Here you can set the opacity between 0 (fully transparent) to 255 (completely opaque).
You need to add alpha to your ListView
.
Use your XML and extend the ListView
definition with alpha-attribute.
<ListView
android:id="@+id/left_drawer"
android:layout_width="240dp"
android:layout_height="match_parent"
android:layout_gravity="start"
android:choiceMode="singleChoice"
android:divider="@android:color/transparent"
android:dividerHeight="0dp"
android:background="#111111"
android:alpha="255"
/>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With