国产探花免费观看_亚洲丰满少妇自慰呻吟_97日韩有码在线_资源在线日韩欧美_一区二区精品毛片,辰东完美世界有声小说,欢乐颂第一季,yy玄幻小说排行榜完本

首頁 > 學院 > 開發設計 > 正文

Progressbar覆蓋不全是圓角的問題

2019-11-09 15:45:19
字體:
來源:轉載
供稿:網友

這里遇到一個就是自定義水平進度條樣式的問題,就是覆蓋在上層的進度不能顯示圓角。 這里寫圖片描述 我們想要實現的效果是如下圖的樣子的。后來發現原因就是我們用了用了clip屬性來切割圖片,被clip切了所以變成了直角,所以我們不用clip標簽改為scale這個標簽就完美解決了。實現效果如下圖: 這里寫圖片描述

1.xml中的引用:

<PRogressBar android:id="@+id/progress_count" style="@style/mProgress_horizontal" android:layout_width="match_parent" android:layout_height="36px" android:layout_marginLeft="35px" android:layout_marginRight="35px" android:layout_marginTop="36px" android:progress="0" android:secondaryProgress="50" />

2.style中的代碼:

<!--自定義水平進度條--> <style name="mProgress_horizontal"> <item name="android:indeterminateOnly">false</item> <item name="android:progressDrawable">@drawable/progressbar_horizontal </item><!-- progress_horizontal --> <item name="android:indeterminateDrawable"> @android:drawable/progress_indeterminate_horizontal </item> </style>

3.關鍵就是這個android:progressDrawable的屬性了,progressbar_horizontal的代碼

<?xml version="1.0" encoding="utf-8"?><layer-list xmlns:android="http://schemas.android.com/apk/res/android"> <item android:id="@android:id/background"> <shape> <corners android:radius="50dip" /> <gradient android:angle="270" android:centerColor="@color/progressbg" android:centerY="0.75" android:endColor="@color/progressbg" android:startColor="@color/progressbg" /> </shape> </item> <item android:id="@android:id/secondaryProgress"> <scale android:scaleWidth="100%"> <shape> <corners android:radius="50dip" /> <gradient android:angle="270" android:centerY="0.75" android:endColor="@color/textorange" android:startColor="@color/orange" /> </shape> </scale> </item> <item android:id="@android:id/progress"> <scale android:scaleWidth="100%"> <shape> <corners android:radius="50dip" /> <gradient android:angle="270" android:centerY="0.75" android:endColor="@color/textorange" android:startColor="@color/orange" /> </shape> </scale> </item></layer-list>可以看到的是我們只是吧<clip/>標簽內容替換為<scale android:scaleWidth="100%">就可以了。或許.9圖也是可以實現的,scale標簽顧名思義就是拉伸的意思。。。不會切割。

總結:開心,開心就好。。。


發表評論 共有條評論
用戶名: 密碼:
驗證碼: 匿名發表
主站蜘蛛池模板: 句容市| 霍邱县| 济源市| 边坝县| 临夏市| 乡宁县| 石林| 黔江区| 芜湖县| 丰县| 醴陵市| 航空| 沐川县| 慈利县| 星座| 宜兰市| 翁源县| 青铜峡市| 清徐县| 石棉县| 涟水县| 佛学| 财经| 顺昌县| 旬阳县| 焦作市| 信阳市| 樟树市| 正镶白旗| 金坛市| 凌云县| 富锦市| 双牌县| 宜阳县| 沙河市| 西吉县| 开阳县| 昔阳县| 蕉岭县| 灵璧县| 康平县|