定制的拇指和分割文本搜索栏 [英] SeekBar with custom thumb and segmented text

查看:175
本文介绍了定制的拇指和分割文本搜索栏的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

您好所有,

我要寻找这样的图像搜索栏。我成功地建立背景,但问题是,下面的拇指和细分文本搜索栏。有谁知道解决方案
谢谢

I am looking for a seekbar like this image. I succeeded in setting background but problem is thumb and segments text below seek bar. Does anyone know solution Thank You

推荐答案

使用这个库这里是最小的例子code为我工作:

Using this library here is a minimum example code that worked for me:

<com.infteh.comboseekbar.ComboSeekBar
        xmlns:custom="http://schemas.android.com/apk/res-auto"
        android:id="@+id/seekbar" 
        android:layout_width="fill_parent"
        android:layout_height="wrap_content"
        custom:color="#000"
        custom:textSize="12sp"
        custom:multiline="false"
        />

然后在活动

private ComboSeekBar mSeekBar;
List<String> seekBarStep = Arrays.asList("All","1","5","10","20");
mDistanceSeekBar.setAdapter(seekBarStep);

这将创建一个使用默认的可绘制一个黑色的分段搜索栏。如果您需要添加一些定制看看 ComboSeekBar.onDraw() CustomDrawable.draw() CustomThumbDrawable.draw()

This will create a black segmented seekbar using default drawables. If you need to add some customization have a look at ComboSeekBar.onDraw(), CustomDrawable.draw() and CustomThumbDrawable.draw().

本项目所有,但完成,但仍然稳固的起点。你可能会需要锻炼的可绘制多一点

This project is all but finished but still a solid starting point. You probably will have to workout the drawables a bit more

这篇关于定制的拇指和分割文本搜索栏的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆