安卓自定义seekbar数值_Android 自定义seekbar【原创】

先看seekbar效果

步骤不难:

1.创建一个layer-list文件

android:id="@android:id/background"

android:drawable="@drawable/bar_time_default"/>

android:angle="270.0"

android:centerColor="#80ffb600"

android:centerY="0.75"

android:endColor="#a0ffcb00"

android:startColor="#80ffd300" />

其中bar_time_default是背景图片,即轨道图片,half_transparent_blue为覆盖色,如图为半透明的蓝色

2.在xml中使用

android:id="@+id/seek_time"

android:progressDrawable="@drawable/seekbar_horizontal"

android:thumb="@drawable/button_time"

android:layout_width="fill_parent"

android:layout_marginLeft="15dp"

android:layout_marginRight="15dp"

android:maxHeight="8dp"

android:max="12"

android:layout_height="wrap_content"

android:layout_marginBottom="10dp"

/>

其中   android:thumb=”@drawable/button_time”就是设置拖动的按钮。这样就完成了,很简单吧

转载时请注明出处及相应链接,本文永久地址:https://blog.yayuanzi.com/8348.html

微信打赏

支付宝打赏

感谢您对作者wangbin的打赏,我们会更加努力!    如果您想成为作者,请点我

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值