先看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的打赏,我们会更加努力! 如果您想成为作者,请点我