Material Design 进度条

圆形进度条

创建

设置主题为 Theme.AppCompat.Light.NoActionBar
或 @android:style/Theme.Material.Light

修改颜色

添加indeterminateTint属性为颜色
设置indeterminateTintMode属性 为 src_atop

    <ProgressBar            android:indeterminateTint="#FFFF0000"            android:indeterminateTintMode="src_atop"            android:layout_width="wrap_content"            android:layout_height="wrap_content" />

横向进度条

进度指示模式

    android:indeterminate="false"

未知进度模式

    android:indeterminate="true"

样式

标准,黄色进度条

style="@android:style/Widget.ProgressBar.Horizontal"

Holo进度条,支持4.0

style="@android:style/Widget.Holo.ProgressBar.Horizontal"

Material进度条,5.0以上

style="@android:style/Widget.Material.ProgressBar.Horizontal"

自定义样式

    <ProgressBar           android:id="@+id/progressbar"          android:layout_width="wrap_content"          android:layout_height="wrap_content"          android:indeterminateDrawable="@drawable/progressbar"          />
progressbar.xml
<?xml version="1.0" encoding="utf-8"?>  <animated-rotate          xmlns:android="http://schemas.android.com/apk/res/android"           android:pivotX="50%" android:pivotY="50%"               android:fromDegrees="0"             android:toDegrees="360">          <shape               android:shape="ring"               android:innerRadiusRatio="3"                android:thicknessRatio="8"               android:useLevel="false">                <gradient                   android:type="sweep"                   android:useLevel="false"                    android:startColor="#6BD3FF"                           android:centerColor="#FF7121"                    android:centerY="0.50"                   android:endColor="#FFFF00" />            shape>    animated-rotate>  

更多相关文章

  1. android 超简单的下载功能,进度条 异步下载
  2. 仿WP8样式的Android ProgressBar
  3. android 播放assets目录内的音乐,及使用Seekbar控制播放进度
  4. Android简易实战教程--第十七话《自定义彩色环形进度条》
  5. Android中的常用控件之进度条(ProgressBar)
  6. MIUI 惊艳锁屏样式5款[Android] | 小众软件 > Android
  7. android Button 样式
  8. Android生命周期和启动模式
  9. Android开发模式:MVP Vs MVVM

随机推荐

  1. 检测android的网络链接状态
  2. Android Studio更新3.1后报错
  3. AndroidAZ系列: 四大组件之Activity(All,
  4. Android 解决Dialog导致软键盘无法隐藏的
  5. Android(安卓)RecyclerView adapter noti
  6. Android 标识绑定View
  7. 修改Android应用程序的默认最大内存值
  8. 【Android】getwidth和getmeasuredwidth
  9. Android(安卓)Studio 4.0 New Class 的坑
  10. android设置默认程序&清除默认设置