seekbar的一些感想
来源:互联网 发布:淘宝主图文字规定 编辑:程序博客网 时间:2024/06/08 14:30
最近项目中要用到seekbar来调节相机的焦距,于是乎打开sdk文档,先看下它的继承体系:
这里可以看出seekbar是继承porgressbar的,一般情况下系统自带的bar比较丑,没法看,要美化,或者重绘。
因为上一个项目使用到了progressbar,而且做了特殊处理,所以我猜想是不是也能够搬到seekbar上。
我继续看文档:
他自己的有一个android:thumb属性,我查了下字典thumb意思是拇指,也是滑动的图片,这个可以替换。其他的属性继承自view和progressbar了。看来progressbar的属性也能用到seekbar上。填充颜色啊,背景啊,之类的。
上一个版本我的progressbar是这样编写的:
布局文件:
<ProgressBarandroid:id="@+id/downloadbar" android:layout_width="fill_parent"android:layout_height="10dip"style="?android:attr/progressBarStyleHorizontal"android:progressDrawable="@drawable/progressbar_layer_list"android:background="@drawable/progressbar_box"/>progressbar_layer_list.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"> <clip> <shape> <corners android:radius="15dip" /> <gradient android:startColor="#00b7ee" android:endColor="#0075a9" android:angle="270" android:centerY="0.75"/> </shape> </clip> </item><item android:id="@android:id/secondaryProgress"> <clip> <shape> <corners android:radius="15dip" /> <gradient android:startColor="#00b7ee" android:endColor="#0075a9" android:angle="270" android:centerY="0.75"/> </shape> </clip> </item> <item android:id="@android:id/progress"><clip><shape><gradient android:startColor="#00b7ee" android:endColor="#0075a9" android:angle="270" android:centerY="0.25"/><corners android:radius="15dip"/></shape></clip></item></layer-list><!--android:drawable="@drawable/progressbar_stroke"-->
背景图片:progressbar_box就不上传了
效果如下:
比系统至少要好看吧,当然每个人审美不一样,呵呵
- seekbar的一些感想
- 关于seekbar的一些问题
- 我的一些感想
- 年末的一些感想
- 最近的一些感想
- 寫線程的一些感想
- “开放”的一些感想
- DWR的一些感想
- 系统分析的一些感想!
- Coding的一些感想
- GBUZZ的一些感想...
- 最近的一些感想
- 最近的一些感想
- 周末的一些感想
- 最近的一些感想
- 嵌入式的一些感想
- C++的一些感想
- 20150716的一些感想
- 联通VAC应答报文
- (转)WTL学习过程中遇到的一些问题总结
- RadioGroup RadioButton ,checkBox ,menu
- Bloom Filter概念和原理
- vs2005常用快捷键
- seekbar的一些感想
- 2011年移动全球开发者大会总结
- progressBar ListView
- 最大子序列、最长公共子串、最长公共子序列
- 在linux下使用valgrind检查wireshark的内存泄露情况
- spinner ArrayAdapter
- (转)ATL:IDispatchImpl, IDispEventImpl, IDispEventSimpleImpl的区别和联系
- SHELL SCRIPT 无聊小程序(二)
- 生成随机数