Android的搜索栏定制 [英] Android SeekBar customization
问题描述
我要创建搜索栏样式Android和无法弄清楚如何做到这一点。这里是最后的结果(这是我想要达到的)画面。
I have to create SeekBar style for Android and can't figure out how to do this. Here is picture of the final result (which I'd like to reach).
让我们开始与搜索栏的背景。我试着将它分为三部分:左侧圆形端,可重复的一块中间环节,和右侧圆形端。而且他们应该加入与下一个code(foo_background.xml)。
Let's start with SeekBar's background. I've tried to split it into three parts: left rounded end, repeatable piece of the middle part, and right rounded end. And them should be joined with next code (foo_background.xml).
<?xml version="1.0" encoding="utf-8"?>
<clip xmlns:android="http://schemas.android.com/apk/res/android"
android:clipOrientation="horizontal" >
<bitmap
android:antialias="true"
android:dither="false"
android:filter="false"
android:gravity="left|center_vertical"
android:src="@drawable/foo_left"
android:tileMode="disabled" />
<bitmap
android:antialias="true"
android:dither="false"
android:filter="false"
android:gravity="center_vertical"
android:src="@drawable/foo_middle"
android:tileMode="repeat" />
<bitmap
android:antialias="true"
android:dither="false"
android:filter="false"
android:gravity="right|center_vertical"
android:src="@drawable/foo_right"
android:tileMode="disabled" />
</clip>
其中是用在搜索栏的背景可绘制文件
Which is used in SeekBar's background drawable file.
<?xml version="1.0" encoding="utf-8"?>
<layer-list xmlns:android="http://schemas.android.com/apk/res/android" >
<item android:id="@android:id/background">
<clip android:drawable="@drawable/foo_background" />
</item>
<item android:id="@android:id/progress">
<clip android:drawable="@drawable/seek_bar_progress" />
</item>
</layer-list>
但由于所有这些东西,结果我看到一个空的(或更好的说,我没有看到它)搜索栏进度线。
But as a result of all this stuff I see an empty (or better say I don't see it) SeekBar progress line.
有哪位知道如何做到这一点在正确的方式? 非常感谢帮助。
Does any know how to do this in right way? Thanks a lot for helping.
推荐答案
试试下面的链接,在这里你将有大约seekbars的定制一些信息。
Try below links here you will have some information about the customization of seekbars.
http://www.techrepublic.com/博客/应用建设者/机器人,搜索栏,您的路/ 943
或
的http://开发商 - 点 - 机器人。 blogspot.in/2012/03/custom-seekbar-tutorial.html
这可能会帮助你....
This may help you....
这篇关于Android的搜索栏定制的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!