課程
/移動開發(fā)
/Android
/Android攻城獅的第二門課(第1季)
請問 ?progress-bar ?是什么樣式的XML
2016-08-07
源自:Android攻城獅的第二門課(第1季) 6-7
正在回答
layer-list的xml
在res里面新建一個drawable,在這里文件夾里面創(chuàng)建然后再在布局文件里面通過 progressDeawable 屬性進行調(diào)用
<layer-list xmlns:android="http://schemas.android.com/apk/res/android" >
? ? ?<!-- 背景顏色 -->
? ? <item android:id="@android:id/background">
? ? ? ? <shape>
? ? ? ? ? ? <corners android:radius="5dip" />
? ? ? ? ? ? <gradient
? ? ? ? ? ? ? ? ? ? android:startColor="#ffffff9d"
? ? ? ? ? ? ? ? ? ? android:centerColor="#0000005a"
? ? ? ? ? ? ? ? ? ? android:centerY="0.75"
? ? ? ? ? ? ? ? ? ? android:endColor="#ffffff74"
? ? ? ? ? ? ? ? ? ? android:angle="270"
? ? ? ? ? ? />
? ? ? ? </shape>
? ? </item>
? ? <!-- 二級進度條 -->
? ? <item android:id="@android:id/secondaryProgress">
? ? ? ? <clip>
? ? ? ? ? ? <shape>
? ? ? ? ? ? ? ? <corners android:radius="5dip" />
? ? ? ? ? ? ? ? <gradient
? ? ? ? ? ? ? ? ? ? ? ? android:startColor="#80ffd300"
? ? ? ? ? ? ? ? ? ? ? ? android:centerColor="#80ffb600"
? ? ? ? ? ? ? ? ? ? ? ? android:centerY="0.75"
? ? ? ? ? ? ? ? ? ? ? ? android:endColor="#a0ffcb00"
? ? ? ? ? ? ? ? ? ? ? ? android:angle="270"
? ? ? ? ? ? ? ? />
? ? ? ? ? ? </shape>
? ? ? ? </clip>
? ? <!-- 一級進度條 -->
? ? <item android:id="@android:id/progress">
? ? ? ? ? ? ? ? ? ? ? ? android:startColor="#00000000"
? ? ? ? ? ? ? ? ? ? ? ? android:centerColor="#ffffff00"
? ? ? ? ? ? ? ? ? ? ? ? android:endColor="#00000000"
</layer-list>
舉報
本課程由淺入深地帶您學(xué)會Android的常用控件的開發(fā)和使用
Copyright ? 2025 imooc.com All Rights Reserved | 京ICP備12003892號-11 京公網(wǎng)安備11010802030151號
購課補貼聯(lián)系客服咨詢優(yōu)惠詳情
慕課網(wǎng)APP您的移動學(xué)習(xí)伙伴
掃描二維碼關(guān)注慕課網(wǎng)微信公眾號
2016-08-07
layer-list的xml
在res里面新建一個drawable,在這里文件夾里面創(chuàng)建然后再在布局文件里面通過 progressDeawable 屬性進行調(diào)用
<layer-list xmlns:android="http://schemas.android.com/apk/res/android" >
? ? ?<!-- 背景顏色 -->
? ? <item android:id="@android:id/background">
? ? ? ? <shape>
? ? ? ? ? ? <corners android:radius="5dip" />
? ? ? ? ? ? <gradient
? ? ? ? ? ? ? ? ? ? android:startColor="#ffffff9d"
? ? ? ? ? ? ? ? ? ? android:centerColor="#0000005a"
? ? ? ? ? ? ? ? ? ? android:centerY="0.75"
? ? ? ? ? ? ? ? ? ? android:endColor="#ffffff74"
? ? ? ? ? ? ? ? ? ? android:angle="270"
? ? ? ? ? ? />
? ? ? ? </shape>
? ? </item>
? ? <!-- 二級進度條 -->
? ? <item android:id="@android:id/secondaryProgress">
? ? ? ? <clip>
? ? ? ? ? ? <shape>
? ? ? ? ? ? ? ? <corners android:radius="5dip" />
? ? ? ? ? ? ? ? <gradient
? ? ? ? ? ? ? ? ? ? ? ? android:startColor="#80ffd300"
? ? ? ? ? ? ? ? ? ? ? ? android:centerColor="#80ffb600"
? ? ? ? ? ? ? ? ? ? ? ? android:centerY="0.75"
? ? ? ? ? ? ? ? ? ? ? ? android:endColor="#a0ffcb00"
? ? ? ? ? ? ? ? ? ? ? ? android:angle="270"
? ? ? ? ? ? ? ? />
? ? ? ? ? ? </shape>
? ? ? ? </clip>
? ? </item>
? ? <!-- 一級進度條 -->
? ? <item android:id="@android:id/progress">
? ? ? ? <clip>
? ? ? ? ? ? <shape>
? ? ? ? ? ? ? ? <corners android:radius="5dip" />
? ? ? ? ? ? ? ? <gradient
? ? ? ? ? ? ? ? ? ? ? ? android:startColor="#00000000"
? ? ? ? ? ? ? ? ? ? ? ? android:centerColor="#ffffff00"
? ? ? ? ? ? ? ? ? ? ? ? android:centerY="0.75"
? ? ? ? ? ? ? ? ? ? ? ? android:endColor="#00000000"
? ? ? ? ? ? ? ? ? ? ? ? android:angle="270"
? ? ? ? ? ? ? ? />
? ? ? ? ? ? </shape>
? ? ? ? </clip>
? ? </item>
</layer-list>