AndroidUi(4)-圓環(huán)

效果圖

Paste_Image.png

<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android" 
android:innerRadiusRatio="3" 
android:shape="ring"    
android:thicknessRatio="9"    
android:useLevel="false">   

 <gradient        
android:endColor="#2F90BD"        
android:startColor="#19a669"        
android:type="sweep" />   

 <stroke        
android:width="0dp"        
android:color="@android:color/black" />

</shape>

shape根元素有些屬性只適用于ring類型:
android:innerRadius 內(nèi)環(huán)的半徑
android:innerRadiusRatio 浮點(diǎn)型,以環(huán)的寬度比率來(lái)表示內(nèi)環(huán)的半徑,默認(rèn)為3,表示內(nèi)環(huán)半徑為環(huán)的寬度除以3,該值會(huì)被android:innerRadius覆蓋
android:thickness 環(huán)的厚度
android:thicknessRatio 浮點(diǎn)型,以環(huán)的寬度比率來(lái)表示環(huán)的厚度,默認(rèn)為9,表示環(huán)的厚度為環(huán)的寬度除以9,該值會(huì)被android:thickness覆蓋
android:useLevel 一般為false,否則可能環(huán)形無(wú)法顯示,只有作為L(zhǎng)evelListDrawable使用時(shí)才設(shè)為true

最后編輯于
?著作權(quán)歸作者所有,轉(zhuǎn)載或內(nèi)容合作請(qǐng)聯(lián)系作者
【社區(qū)內(nèi)容提示】社區(qū)部分內(nèi)容疑似由AI輔助生成,瀏覽時(shí)請(qǐng)結(jié)合常識(shí)與多方信息審慎甄別。
平臺(tái)聲明:文章內(nèi)容(如有圖片或視頻亦包括在內(nèi))由作者上傳并發(fā)布,文章內(nèi)容僅代表作者本人觀點(diǎn),簡(jiǎn)書系信息發(fā)布平臺(tái),僅提供信息存儲(chǔ)服務(wù)。

相關(guān)閱讀更多精彩內(nèi)容

友情鏈接更多精彩內(nèi)容