ProgressBar背景的改变
其实说白了改变背景就是改变样式
<ProgressBar
android:id=\"@+id/progress_bar\"
android:layout_width=\"40dip\"
android:layout_height=\"40dip\"
android:padding=\"6dp\"
android:indeterminate=\"true\"
style=\"?android:attr/progressBarStyleInverse\"
/>
上面只实用白色背景程序的progressbar
或者呢 自己写一个样式
<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=\"#ff9d9e9d\"
android:centerColor=\"#ff5a5d5a\"
android:centerY=\"0.75\"
android:endColor=\"#ff747674\"
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=\"@color/progress_start\"
android:endColor=\"@color/progress_end\"
android:angle=\"270\"
/>
</shape>
</clip>
</item>
</layer-list>

然后
.setProgressDrawable

更多相关文章

  1. Android中的预定义样式
  2. Android预定义样式
  3. Android(安卓)渐变drawable背景
  4. Android(安卓)TextView背景色、圆角、内部填充设置
  5. android 用代码画虚线边框背景
  6. Android引用资源(resources) vs 引用样式属性(style attribute)语法
  7. Android基础————UI布局之高级控件详解
  8. Android善用预定义样式
  9. Android中由于设置的背景图片太大导致OOM

随机推荐

  1. Centos7配置阿里云DNS
  2. Centos8 yum 阿里源配置的问题
  3. Firefox配置阿里云DNS
  4. Vmware安装Ubuntu16.4的过程及出现问题的
  5. 人体结构如何画?漫画简单人体结构画法
  6. 【北亚数据恢复】服务器重装系统后分区消
  7. mvc pathinfo 路由的解析原理
  8. 加快 Node.js 应用的启动速度
  9. 基于Springboot docker jenkins 自动化部
  10. MongoDB 4.X CRUD的基本操作说明