android自定义progressbar
来源:互联网 发布:台式机显卡温度 知乎 编辑:程序博客网 时间:2024/05/21 18:31
目前项目中需要用到动态的progressbar,经过几番查找,动态效果是实现了,可作为progressbar最重要的特性-进度条却不起作用了,看起来进度条似乎变成了一个动态的图片...下面贴代码,请各位看官给在下解惑
定义progressbar
<ProgressBar android:id="@+id/login_progress_bar"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
style="@style/newProgressStyle"
android:max="100"
android:progress="10"
android:paddingTop="10dip"/>
定义style
<style name="newProgressStyle" parent="@android:style/Widget.ProgressBar.Small">
<item name="android:indeterminateDrawable">@anim/progress_indeterminate_horizontal</item>
<item name="android:indeterminateOnly">true</item>
</style>
定义anim
<animation-list
xmlns:android="http://schemas.android.com/apk/res/android"
android:oneshot="false">
<item android:drawable="@drawable/progressbar_indeterminate1" android:duration="200" />
<item android:drawable="@drawable/progressbar_indeterminate2" android:duration="200" />
<item android:drawable="@drawable/progressbar_indeterminate3" android:duration="200" />
</animation-list>
注:anim中三张图片全为android SDK 自带,搜索copy到drawable目录下即可。
定义progressbar
<ProgressBar android:id="@+id/login_progress_bar"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
style="@style/newProgressStyle"
android:max="100"
android:progress="10"
android:paddingTop="10dip"/>
定义style
<style name="newProgressStyle" parent="@android:style/Widget.ProgressBar.Small">
<item name="android:indeterminateDrawable">@anim/progress_indeterminate_horizontal</item>
<item name="android:indeterminateOnly">true</item>
</style>
定义anim
<animation-list
xmlns:android="http://schemas.android.com/apk/res/android"
android:oneshot="false">
<item android:drawable="@drawable/progressbar_indeterminate1" android:duration="200" />
<item android:drawable="@drawable/progressbar_indeterminate2" android:duration="200" />
<item android:drawable="@drawable/progressbar_indeterminate3" android:duration="200" />
</animation-list>
注:anim中三张图片全为android SDK 自带,搜索copy到drawable目录下即可。
- 【ProgressBar】Android 自定义ProgressBar集锦
- android自定义标题栏progressBar
- android 自定义ProgressBar
- Android 自定义ProgressBar (一)
- android自定义progressbar
- Android 自定义progressbar
- android 自定义progressbar
- Android自定义RatingBar && ProgressBar
- Android 自定义ProgressBar
- Android开发 自定义ProgressBar
- android自定义ProgressBar
- Android中自定义ProgressBar
- 【Android】自定义ProgressBar
- Android 自定义ProgressBar
- android 自定义ProgressBar
- Android progressBar 自定义
- Android 自定义ProgressBar
- android自定义ProgressBar
- 关于员工激励的思考-期望理论
- 程序员也要养生
- MSP430命名规则
- 一款不错的网站压力测试工具webbench
- spagobi系列文章-07 自定义报表(图表)
- android自定义progressbar
- ffmpeg h264实时解码用到的函数
- 进度条加载完自动隐藏
- Facebook的公平份额调度器FairScheduler
- SQL Server 2005“备份集中的数据库备份与现有的数据库不同”解决方法
- Sql Server查询性能优化之不可小觑的书签查找
- ARM 寄存器说明
- 日志程序
- shell 命令