简体   繁体   中英

Round the background color in the navigation drawer with Android Studio

I'm looking for a design similar to what the latest google apps do and i'm looking to get this rendering, I pretty much did something similar but I miss rounding the color, thank you very much

The rendering I would like to have

Rounded shape:

<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android"
   android:shape="rectangle"
   android:tint="@color/your_color">
   <corners
       android:bottomRightRadius="32dp"
       android:topRightRadius="32dp" 
   />

   <!--    <size android:height="64dp" />--> // if you want to set height
</shape>

selector:

<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
    <item android:drawable="@drawable/rounded_shape" android:state_checked="true"/>
</selector>

app:itemBackground="@drawable/selector_item" to your NavigationView.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM