自定义seekbar中,thumb被覆盖掉一部分问题
来源:互联网 发布:昆山美工培训多少钱 编辑:程序博客网 时间:2024/04/27 19:13
From:http://blog.csdn.net/dany1202/article/details/6015008
(图一) (图二) (图三)
做一个自定义的seekbar,更改其背景图片:
- <com.android.Progress
- android:id="@+id/focus_seekbar"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:layout_below="@id/seekbar_add"
- android:progressDrawable="@drawable/seekbar_img"
- android:thumb="@drawable/thumb"
- android:max = "60"/>
定义progressDrawable即为背景图片。thumb为滑块图片
如上定义xml文件,启动程序,生成如图一。 thumb滑块不能显示完全,一部分被隐藏掉。
增加属性:
- android:thumbOffset="0dip"
即可实现thumb不被覆盖,即最下方位置如图三所示,不会出现图一情况。
网上有个竖直的VerticalSeekBar,简单说一下他的使用:
当滑块的大小比下面的背景大时,此时要设置
android:minHeight="19dip"
android:maxHeight="19dip"
19dip即为seek_img图片的宽度。
而控件的layout_width值即位滑块的width和height值
- <com.android.VerticalSeek
- android:id="@+id/focus_seekbar"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:progressDrawable="@drawable/seekbar_img"
- android:thumb="@drawable/thumb"
- android:thumbOffset="0dip"
- android:max = "59"
- android:layout_centerVertical="true"
- android:minHeight="19dip"
- android:maxHeight="19dip"
- android:paddingLeft="-15dip"
- android:paddingRight="-15dip"/>
这么个小问题,用了我半天时间才搞出来。网上资源太少了,给大家分享一下。
<?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>
<corners android:radius="5dip" />
<gradient
android:startColor="#ff364956"
android:centerColor="#ff444444"
android:centerY="0.75"
android:endColor="#ff00112e"
android:angle="90"
/>
</shape>
</item>
<item android:id="@android:id/secondaryProgress">
<clip>
<shape>
<corners android:radius="5dip" />
<gradient
android:startColor="#80364956"
android:centerColor="#802f67a6"
android:centerY="0.75"
android:endColor="#8000112e"
android:angle="270"
/>
</shape>
</clip>
</item>
<item android:id="@android:id/progress">
<clip>
<shape>
<corners android:radius="5dip" />
<gradient
android:startColor="#ff9ee5ff"
android:centerColor="#ff9ee5ff"
android:centerY="0.75"
android:endColor="#ff9ee5ff"
android:angle="90"
/>
</shape>
</clip>
</item>
</layer-list>
- 自定义seekbar中,thumb被覆盖掉一部分问题
- 自定义seekbar中,thumb被覆盖掉一部分问题
- 自定义seekbar中,thumb被覆盖掉一部分问题
- 自定义seekbar中,thumb被覆盖掉一部分问题
- 自定义seekbar中,thumb被覆盖掉一部分问题
- 自定义seekbar中,thumb被覆盖掉一部分问题
- 自定义seekbar中,thumb被覆盖掉一部分问题
- 自定义seekbar中,thumb被覆盖掉一部分问题
- 自定义seekbar中,thumb被覆盖掉一部分问题
- 自定义seekbar中,thumb被覆盖掉一部分问题——thumbOffset属性设置
- 自定义seekbar中,圆球显示不全被覆盖掉一部分问题
- seekbar thumb现实问题
- 嵌入式开发中局部变量被覆盖问题
- Ubuntu Server 中resolv.conf重启时被覆盖的问题
- Ubuntu Server 中resolv.conf重启时被覆盖的问题
- AWS EC2中motd文件被覆盖问题
- linux so 动态库中全局变量 被覆盖问题
- Android自定义SeekBar thumb透明效果
- java 判断一个字符串中的字符是否唯一
- EBS R12.2.3克隆
- NSInvocation的使用
- Codeforces初体验
- 侧滑菜单 Android开源项目SlidingMenu深切解析
- 自定义seekbar中,thumb被覆盖掉一部分问题
- 再谈应用环境下的TIME_WAIT和CLOSE_WAIT
- 懒虫小鑫
- 在Windows2012下配置Mercurial
- 编译Android源码制作ROM
- 深入理解OAuth2.0协议
- oracle 11g 中 (oracle 10g) crsctl 的 替换命令
- Nutch-hadoop集群配置——Ubuntu10.04
- C#通过WebService获取JSON数据并快速解析(百度地图坐标转换API为例)