自定义seekBar样式
来源:互联网 发布:代购淘宝描述模板 编辑:程序博客网 时间:2024/05/21 11:24
效果:
(一)在res/value/style下定义样式Widget.SeekBar.Normal
<?xml version="1.0" encoding="utf-8"?><resources> <style name="Widget.SeekBar.Normal" parent="@android:style/Widget.SeekBar"> <item name="android:maxHeight">8.0dip</item> <item name="android:indeterminateOnly">false</item> <item name="android:indeterminateDrawable">@android:drawable/progress_indeterminate_horizontal</item> <item name="android:progressDrawable">@drawable/seekbar_horizontal</item> <item name="android:minHeight">8.0dip</item> <item name="android:thumb">@drawable/seek_thumb</item> <item name="android:thumbOffset">10.0dip</item> </style> </resources>
(二)在drawable下建xmlseekbar_horizontal.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" android:drawable="@drawable/seek_bkg" /> <item android:id="@android:id/secondaryProgress"> <clip> <shape> <corners android:radius="2.0dip" /> <gradient android:startColor="#80ffd300" android:endColor="#a0ffcb00" android:angle="270.0" android:centerY="0.75" android:centerColor="#80ffb600" /> </shape> </clip> </item> <item android:id="@android:id/progress"> <clip android:drawable="@drawable/seek" /> </item></layer-list>
<SeekBar android:id="@+android:id/progresss"android:layout_width="fill_parent" android:layout_height="wrap_content"android:layout_marginTop="50dip" style="@style/Widget.SeekBar.Normal" />
3张图片:
seek.9.png
seek_bkg.9.png
seek_thumb.png
0 0
- SeekBar 的自定义样式
- 自定义seekbar样式
- 【Android】自定义seekbar样式
- android,自定义seekbar,样式
- Android:自定义SeekBar样式
- Android 自定义seekbar样式
- Android 自定义SeekBar样式
- Android SeekBar 样式自定义
- SeekBar自定义样式
- seekbar 自定义样式
- 自定义Seekbar样式
- 自定义SeekBar样式实现
- 【android】seekbar 样式自定义
- 自定义Android SeekBar样式
- 自定义seekBar样式
- 自定义seekBar的样式
- 自定义SeekBar样式
- 自定义SeekBar样式
- UVa 1641 ASCII Area
- 如何使用jarsigner签名apk
- 批量建立软连接
- Java几个细节和误区
- OpenGL ES学习之基础工作
- 自定义seekBar样式
- Android Studio插件收集
- 异常 E/MessageQueue-JNI(796): java.lang.IndexOutOfBoundsException: Invalid index 1, size is 1
- kettle 批量抽取多个表数据
- 欢迎使用CSDN-markdown编辑器
- PHP轮询API
- html页面模仿定时任务
- 关于border-radius
- javase 专题 之反射和动态代理