国产探花免费观看_亚洲丰满少妇自慰呻吟_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標簽顧名思義就是拉伸的意思。。。不會切割。

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


發表評論 共有條評論
用戶名: 密碼:
驗證碼: 匿名發表
主站蜘蛛池模板: 高邑县| 天祝| 巢湖市| 射洪县| 武邑县| 青阳县| 河池市| 中江县| 万安县| 宝坻区| 建宁县| 绥滨县| 闸北区| 鸡西市| 武乡县| 榆林市| 囊谦县| 衡阳县| 南昌市| 湟中县| 卢氏县| 德保县| 沛县| 射阳县| 南川市| 临沧市| 武义县| 白银市| 永嘉县| 龙游县| 牙克石市| 内乡县| 凤庆县| 兴山县| 深水埗区| 腾冲县| 黄浦区| 黎城县| 额尔古纳市| 九江市| 德昌县|