shape 寫法基本大概如下
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="rectangle">
<stroke android:width="1px" android:color="#A9B7CA" />
<solid android:color="#A9B7CA" />
<corners android:radius="1dp"
android:bottomRightRadius="0dip"
android:bottomLeftRadius="0dip"
android:topLeftRadius="0dip"
android:topRightRadius="4dip" />
</shape>
上面stroke為邊框,solid為背景色,corners 為邊角設定
完成後可在layout的Background等用到Drawable的屬性用之
ref:
沒有留言 :
張貼留言