<shape>
用于繪制幾何形狀(geometric shape)
支持以下屬性:
形狀 android:shape
- rectangle 長方形
- ring 圓形
- oval 橢圓形
- line 直線
內(nèi)邊框填充 <padding>
當(dāng)Shape用作View的android:background時,Shape的<padding>屬性將應(yīng)用于View。但是,當(dāng)View顯式設(shè)置了<padding>時,Shape 的<padding>無效。
填充顏色 <solid>
填充漸變色 <gradient>
- android:startColor 起始色
- android:endColor 結(jié)束色
- android:centerColor 中間色
- android:centerX 橫向中間位置
- android:centerY 縱向中間位置
注意:<solid>會覆蓋<gradient>屬性
筆劃 <stroke>
- android:width 粗細(xì)
- android:color 顏色
- android:dashGap 虛線間的間隔
- android:dashWidth 虛線的寬度
筆劃可以是實(shí)線或者虛線。
同時設(shè)置android:dashWidth和android:dashGap時,筆劃為虛線。