亚洲乱码中文字幕综合,中国熟女仑乱hd,亚洲精品乱拍国产一区二区三区,一本大道卡一卡二卡三乱码全集资源,又粗又黄又硬又爽的免费视频

Android Shape屬性創(chuàng)建環(huán)形進度條

 更新時間:2019年11月29日 10:40:34   作者:Cricket_小帥  
這篇文章主要介紹了Android Shape屬性創(chuàng)建環(huán)形進度條的實例代碼,代碼簡單易懂,非常不錯,具有一定的參考借鑒價值,需要的朋友可以參考下

1,實現(xiàn)效果 

   

 2,實現(xiàn)代碼:
【1】 shape_drawable.xml 文件

<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android"
  android:innerRadius="20dp"
  android:shape="ring"
  android:thickness="8dp"
  android:useLevel="false" >

  <gradient android:angle="0"
    android:startColor="@color/normal"
    android:centerColor="#5027844F"
    android:endColor="#fff"
    android:useLevel="false"
    android:type="sweep"
    />
</shape>

 【2】 我們將該自定義環(huán)形圈設(shè)置給一個旋轉(zhuǎn)動畫,并利用該旋轉(zhuǎn)動畫自定義成一個環(huán)形進度圈的style,最后將該自定義的style賦值給Progress組件。
progress_rotate文件

<?xml version="1.0" encoding="utf-8"?>
<rotate xmlns:android="http://schemas.android.com/apk/res/android"
  android:drawable="@drawable/shape_drawable"
  android:pivotX="50%"
  android:pivotY="50%"
  android:fromDegrees="0"
  android:toDegrees="360"
  >
</rotate>

 【3】 自定義Progress的style:
CustomProgressStyle文件

<style name="CustomProgressStyle" >
  <item name="android:indeterminateDrawable">@drawable/progress_rotate</item>
  <item name="android:minWidth">72dp</item>
  <item name="android:maxWidth">72dp</item>
  <item name="android:minHeight">72dp</item>
  <item name="android:maxHeight">72dp</item>
</style> 

【4】 應(yīng)用到Progress組件

<ProgressBar
   android:layout_width="100dp"
   android:layout_height="100dp"
   android:layout_centerInParent="true"
   style="@style/CustomProgressStyle"
   android:indeterminateDuration="700"
   />

總結(jié)

以上所述是小編給大家介紹的Android Shape屬性創(chuàng)建環(huán)形進度條,希望對大家有所幫助,如果大家有任何疑問請給我留言,小編會及時回復(fù)大家的。在此也非常感謝大家對腳本之家網(wǎng)站的支持!
如果你覺得本文對你有幫助,歡迎轉(zhuǎn)載,煩請注明出處,謝謝!

相關(guān)文章

  • android TextView 設(shè)置和取消刪除線的兩種方法

    android TextView 設(shè)置和取消刪除線的兩種方法

    這篇文章主要介紹了android TextView 設(shè)置和取消刪除線的兩種方法,小編覺得挺不錯的,現(xiàn)在分享給大家,也給大家做個參考。一起跟隨小編過來看看吧
    2018-03-03
  • Android使用CardView實現(xiàn)圓角對話框

    Android使用CardView實現(xiàn)圓角對話框

    這篇文章主要為大家詳細介紹了Android使用CardView實現(xiàn)圓角對話框,具有一定的參考價值,感興趣的小伙伴們可以參考一下
    2018-11-11
  • flutter中的資源和圖片加載示例詳解

    flutter中的資源和圖片加載示例詳解

    這篇文章主要為大家介紹了flutter中的資源和圖片加載示例詳解,有需要的朋友可以借鑒參考下,希望能夠有所幫助,祝大家多多進步,早日升職加薪
    2022-12-12
  • 基于Viewpager2實現(xiàn)登錄注冊引導(dǎo)頁面

    基于Viewpager2實現(xiàn)登錄注冊引導(dǎo)頁面

    這篇文章主要為大家詳細介紹了基于Viewpager2實現(xiàn)登錄注冊引導(dǎo)頁面,文中示例代碼介紹的非常詳細,具有一定的參考價值,感興趣的小伙伴們可以參考一下
    2022-09-09
  • Android編程之四種Activity加載模式分析

    Android編程之四種Activity加載模式分析

    這篇文章主要介紹了Android編程之四種Activity加載模式,簡要分析了Android編程中涉及的Activity的四種加載模式,具有一定參考借鑒價值,需要的朋友可以參考下
    2016-01-01
  • Android搶紅包助手開發(fā)全攻略

    Android搶紅包助手開發(fā)全攻略

    這篇文章主要為大家詳細介紹了Android搶紅包助手開發(fā)全攻略,感興趣的小伙伴們可以參考一下
    2016-07-07
  • Android中TextView顯示圓圈背景或設(shè)置圓角的方法

    Android中TextView顯示圓圈背景或設(shè)置圓角的方法

    TextView顯示文本給用戶,并允許他們選擇編輯。TextView是一個完整的文本編輯器,但是其基本類配置為不允許編輯。下面這篇文章主要給大家介紹了關(guān)于Android中TextView顯示圓圈背景或設(shè)置圓角的方法,需要的朋友可以參考借鑒,下面來一起看看吧。
    2017-05-05
  • Android實現(xiàn)短信驗證碼自動填寫

    Android實現(xiàn)短信驗證碼自動填寫

    這篇文章主要為大家詳細介紹了Android短信驗證碼自動填寫功能的實現(xiàn)過程,感興趣的小伙伴們可以參考一下
    2016-08-08
  • Android實現(xiàn)簡單的下拉刷新pulltorefresh

    Android實現(xiàn)簡單的下拉刷新pulltorefresh

    這篇文章主要為大家詳細介紹了Android實現(xiàn)簡單的下拉刷新pulltorefresh的相關(guān)代碼,具有一定的實用性和操作價值,感興趣的小伙伴們可以參考一下
    2016-07-07
  • 使用RecyclerView實現(xiàn)水平列表

    使用RecyclerView實現(xiàn)水平列表

    這篇文章主要為大家詳細介紹了使用RecyclerView實現(xiàn)水平列表,具有一定的參考價值,感興趣的小伙伴們可以參考一下
    2019-09-09

最新評論