欧美bbbwbbbw肥妇,免费乱码人妻系列日韩,一级黄片

Android開發(fā)手冊(cè)shape屬性和子屬性使用說(shuō)明

 更新時(shí)間:2022年06月11日 09:37:59   作者:芝麻粒兒  
這篇文章主要為大家介紹了Android開發(fā)手冊(cè)shape屬性和子屬性使用說(shuō)明,有需要的朋友可以借鑒參考下,希望能夠有所幫助,祝大家多多進(jìn)步,早日升職加薪

??shape屬性詳解

<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android"
    android:innerRadius="30dp"
    android:innerRadiusRatio="2"
    android:shape="ring"
    android:thickness="2dp"
    android:thicknessRatio="3"
    android:useLevel="false">
</shape>
  • android:shape="line"  shape的形狀,默認(rèn)為矩形,可以設(shè)置為矩形(rectangle)、橢圓形(oval)、線性形狀(line)、環(huán)形(ring) 
  • android:innerRadius  尺寸,內(nèi)環(huán)的半徑,僅是ring環(huán)形可用。 
  • android:innerRadiusRatio  浮點(diǎn)型,以環(huán)的寬度比率來(lái)表示內(nèi)環(huán)的半徑,比如環(huán)的寬度為50,比例為2.5,那么內(nèi)環(huán)半徑為20
  • android:thickness  尺寸,環(huán)的厚度 
  • android:thicknessRatio 浮點(diǎn)型,以環(huán)的寬度比率來(lái)表示環(huán)的厚度,和innerRadiusRatio相似
  • android:useLevel  boolean值,有時(shí)必須要加上她才有效果,寫上就有效果了

??子屬性詳解

<corners    //定義圓角   
    android:radius="10dp"      //全部的圓角半徑,例:10dp  
    android:topLeftRadius="10dp"   //左上角的圓角半徑,例:10dp  
    android:topRightRadius="10dp"  //右上角的圓角半徑,例:10dp  
    android:bottomLeftRadius="10dp"    //左下角的圓角半徑,例:10dp  
    android:bottomRightRadius="10dp" />    //右下角的圓角半徑,例:10dp  
<solid android:color="#ffff00" /> //只有一個(gè)color,設(shè)置填充顏色即可。  
<gradient  
    android:type="linear"   //共有3中漸變類型,線性漸變(默認(rèn)linear)/放射漸變(radial)/掃描式漸變(sweep)  
    android:angle="0"     //漸變角度,必須為45的倍數(shù),0為從左到右,90為從上到下 ,僅在線性漸變生效  
    android:centerX="0.2"     //漸變中心X的相當(dāng)位置,范圍為0~1,多應(yīng)用于放射漸變  
    android:centerY="0.1"     //漸變中心Y的相當(dāng)位置,范圍為0~1,多應(yīng)用于放射漸變  
    android:startColor="#ff0000"   //漸變開始點(diǎn)的顏色  
    android:centerColor="#ffff00"  //漸變中間點(diǎn)的顏色,在開始與結(jié)束點(diǎn)之間   
    android:endColor="#00ff00"    //漸變結(jié)束點(diǎn)的顏色  
    android:gradientRadius="10"  //漸變的半徑,只有當(dāng)漸變類型為radial時(shí)才能使用   
    android:useLevel="false" />  //屬性通常不使用。該屬性用于指定是否將該shape當(dāng)成一個(gè)LevelListDrawable來(lái)使用,默認(rèn)值為false。
<stroke     
    android:width="dimension"    //表示描邊的寬度 
    android:color="#00ff00"   //表示描邊的顏色,例綠色 
    android:dashWidth="8dp"   //虛線的寬度,值為0時(shí)便是實(shí)線,例8dp寬
    android:dashGap="1dp" />   //虛線的間隔,例間隔1dp

以上就是Android開發(fā)手冊(cè)shape屬性和子屬性使用說(shuō)明的詳細(xì)內(nèi)容,更多關(guān)于Android開發(fā)shape屬性子屬性的資料請(qǐng)關(guān)注腳本之家其它相關(guān)文章!

相關(guān)文章

最新評(píng)論