使用Android Studio在导航抽屉中圆滑的背景色。

问题描述 投票:0回答:1

我正在寻找一个类似于最新的谷歌应用程序的设计,我希望得到这个渲染,我几乎做了类似的东西,但我错过了圆形的颜色,非常感谢你。

我想要的渲染图

android
1个回答
0
投票

圆润的形状。

<?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>

选择器:

<?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="@drawableselector_item" 到您的导航视图。

© www.soinside.com 2019 - 2024. All rights reserved.