Android知识点——indeterminate属性
来源:互联网 发布:淘宝客能挣钱吗 编辑:程序博客网 时间:2024/06/01 09:08
属性:android:indeterminate
在对进度条SeekBar或者ProgressBar设置进度的时候,有些时候我们并不知具体进度值是多少,但是也需要有动态进度的提醒。
如下图(忽略因录制导致的卡顿问题)
- 实现如上效果,设置indeterminate 属性为true即可,那么进度条将采用“模糊模式”
<SeekBar android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_centerInParent="true" android:indeterminate="true"/><ProgressBar android:layout_width="match_parent" android:layout_height="wrap_content" style="@style/Widget.AppCompat.ProgressBar.Horizontal" android:indeterminate="true"/>
- 设置indeterminate 属性为false,则进度条采用“非模糊模式”。则可以根据实际需求修改进度。
修改样式
在drawable文件夹下定义bar_style.xml
<?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> <solid android:color="#ff51495e" /> </shape> </item> <item android:id="@android:id/secondaryProgress"> <clip> <shape> <solid android:color="#ff78495e" /> </shape> </clip> </item> <item android:id="@android:id/progress"> <clip> <shape> <solid android:color="#ff996dfe" /> </shape> </clip> </item></layer-list>
控件引入drawable
<SeekBar android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_centerInParent="true" android:progressDrawable="@drawable/bar_style" android:thumb="@null" android:progress="30" android:secondaryProgress="40" android:indeterminate="false"/><ProgressBar android:layout_width="match_parent" android:progress="30" android:layout_height="wrap_content" android:secondaryProgress="40" android:progressDrawable="@drawable/bar_style" style="@style/Widget.AppCompat.ProgressBar.Horizontal" android:indeterminate="false"/>
0 0
- Android知识点——indeterminate属性
- indeterminate——checkbox属性,表示“不能确定是否选取”状态
- checkbox的indeterminate属性
- HTML5中indeterminate属性
- Android知识点——android:configChanges属性
- [Android] 自定义Indeterminate ProgressBar颜色
- 使用CheckBox的indeterminate属性的问题
- android知识点:duplicateParentState属性
- Android知识点textview的属性
- Indeterminate Checkboxes
- Android适配——知识点
- Android——知识点备忘
- Android知识点——TaskStackBuilder
- h5表单新增元素与属性control、placeholder、list、AutoComplete、pattern、SelectionDirection、indeterminate、
- Android知识点textview加横线的属性
- Android Studio 1.1.0 无法在ActionBar显示模糊进度条Indeterminate ProgressBar
- android中的小知识点——不断更新
- Android小知识点—ProgressBar、SharedPreferences
- js几种实用的跨域方法和原理
- 函数,const指针参数,递归,指向函数的指针
- NoSQL--键值
- 从0到1学习node(七)之express搭建简易论坛
- TensorFlow入门(二)简单前馈网络实现 mnist 分类
- Android知识点——indeterminate属性
- FLV学习(一)网上资源搜集
- Singleton 单例模式(懒汉方式和饿汉方式)
- 自适应阈值(有问题)
- EXC_BAD_ACCESS 和“thread 1: signal SIGABRT”
- HDU 5726 GCD(RMQ 查询 + 二分)
- 自定义Banner轮播广告(真*无限循环无卡顿&设置切换速度)
- leetcode算法第二题
- 第一周算法设计与分析:Container with most water