andorid 自定义seekbar
效果如图:

- <?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>
seekbar_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>
使用方法main.xml
- <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" />
seek.9.png

seek_bkg.9.png

seek_thumb.png

<?xml version="1.0" encoding="utf-8"?>
<shape
xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="oval"
android:useLevel="false">
<solidandroid:color="@color/red"/>
<stroke
android:width="1dp"
android:color="@color/white"/>
<sizeandroid:width="20dp"
android:height="20dp"/>
</shape>
andorid 自定义seekbar的更多相关文章
- andorid——自定义seekbar(转)
xml 新建=>xml=>values <?xml version="1.0" encoding="utf-8"?> <resou ...
- 自定义SeekBar的使用
一.seekbar是进度条,可以使用系统的,也可以自己定义,下面我们将自己定义一个seekbar. 1.自定义滑条,包括对背景,第一进度,第二进度的设置,通过一个xml来实现,在drawable下创建 ...
- Android自定义Seekbar拖动条式样
SeekBar拖动条可以由用户控制,进行拖动操作.比如,应用程序中用户需要对音量进行控制,就可以使用拖动条来实现. 1.SeekBar控件的使用 1.1SeekBar常用属性 SeekBar的常用属性 ...
- Android 开发之网易云音乐(或QQ音乐)的播放界面转盘和自定义SeekBar的实现
这个东西我在eoeAndroid上首发的,但没有详细的实现说明:http://www.eoeandroid.com/thread-317901-1-1.html 在csdn上进行详细的说明吧.(同时上 ...
- Android 自定义seekbar中,thumb被覆盖掉一部分问题
(图一) (图二) (图三) 做一个自定义的seekbar,更改其背景图片: <com.android.Progress android:id="@+id/focus_seek ...
- 【转】 为SeekBar滑块设置固定值以及自定义Seekbar,progressbar样式--不错
原文网址:http://blog.csdn.net/jdsjlzx/article/details/7804080 最近在项目中使用到了seekbar和progressbar,且必须按照设计要求来进行 ...
- 自定义seekbar中,thumb被覆盖掉一部分问题
- Android自定义Seekbar滑动条,Pop提示跟随滑动按钮一起滑动
由于项目需要做出此效果,自定义写了一个. 效果图 思路: 原始的seekbar只有滑动条并没有下方的提示文字,所以我们必须要继承Seekbar重写这个控件. 代码: 在values文件夹下新建attr ...
- Android简易实战教程--第三十四话《 自定义SeekBar以及里面的一些小知识》
转载本专栏文章,请注明出处尊重原创:博客地址http://blog.csdn.net/qq_32059827/article/details/52849676:小杨的博客 许多应用可能需要加入进度,例 ...
随机推荐
- java微信开发(wechat4j)——wechat4j配置文件解读
wechat4j的配置文件是wechat4j.properties.需要放置在项目src目录下.在wechat4j.jar中的META-INF下有一个wechat4j.properties.sampl ...
- ServiceLocator是反模式
关于ServiceLocator模式 http://www.cnblogs.com/hwade/archive/2011/01/30/CommonServiceLocator.html 为什么是Ant ...
- PHP调用SQL Server存储过程
一.安装SQL Server Driver for PHP 在微软官网上发现了这个东西,他提供了一套PHP对MS2005/2008操作的全新函数库,并且支持UTF8,作为PHP的扩展运行.看来 ...
- 在sap系统设置纸张打印格式(针式打印机)
在sap做一个打印报表,要先设置一个纸张打印格式,下面以工厂中常用来打印的针孔纸为例,在sap设置该纸张的打印格式,以用于报表: 1.运行事务代码SPAD:选择工具栏上的[完全管理]按钮——>选 ...
- andriod 获得drawable下所有图片
package com.example.yanlei.my1; import android.app.AlertDialog; import android.content.Context; impo ...
- 微信支付redirect_uri参数错误
在做微信支付的时候,点击提交,出现“redirect_uri参数错误”.经过查找,需要在后台正确设置授权域名.大致步骤如下:1.首先登录微信公众号管理后台2.点击开发者中心3.找到 网页账号—> ...
- SCOM Visio监控 与sharepoint 2010 整合
激活sharepoint 2010的企业版网站功能 在sharepoint 前端服务器安装:OpsMgrDataModule.msi,安装好后可以看到如下东东: 在Sharepoint前端服务器中启动 ...
- 简单认识UISwitch
以下是常用属性: self.mySwitch.layer.cornerRadius = 15; // 边框圆角角度 self.mySwitch.layer.borderWidth = 2; // ...
- JAVA基础学习day17--集合工具类-Collections
一.Collection简述 1.1.Collection与Collections的区别 Collections是集合的静态工具类 Collection:是集合的顶级接口 二.Sort 2.1.sor ...
- LeetCode 5 Longest Palindromic Substring(最长子序列)
题目来源:https://leetcode.com/problems/longest-palindromic-substring/ Given a string S, find the longest ...