我需要使用形状 xml 在 android 中制作这个形状
形状需要是左上角和右上角圆角的矩形,底角保持原样。
我尝试了以下但没有用
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="rectangle" >
<corners
android:topLeftRadius="10dp"
android:topRightRadius="10dp"
/>
<gradient
android:angle="270"
android:endColor="@color/Red"
android:startColor="@color/Red"
android:type="linear" />
</shape>
最佳答案
<?xml version="1.0" encoding="UTF-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android" >
<solid android:color="#ff0000" />
<corners
android:topLeftRadius="4dp"
android:topRightRadius="4dp" />
<padding
android:bottom="5dip"
android:left="10dip"
android:right="10dip"
android:top="5dip" />
</shape>
关于android - 我怎样才能制作这种可绘制的形状,android?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/22164469/