如何使用步进值自定义搜索栏 [英] How to Customize seekbar with stepvalues

查看:79
本文介绍了如何使用步进值自定义搜索栏的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要像这样的搜索栏:

I need seekbar like this :

如果有人像自定义帮助一样自定义了搜索栏,我不知道如何设置搜索栏的步长值

I don't know how to set step values for seekbar if anybody has customized seekbar like kindly help me

推荐答案

我将建议三种方式.首先使用comboSeekBar,它可以满足您的需求.

I will suggest three ways. First to use comboSeekBar which does what you need.

请参见这个. 库链接

secondlysecondly一样,您可以像此示例一样,使用incrementProgressBy更改搜索栏的步骤.或者,您可以将Max设置为7 .对于每个步骤multiply the progress,其中10个为此示例.

And secondly you can simply change step in Seekbar using incrementProgressBy as this Example doing. Or you can setMax to 7 . And for each step multiply the progress with 10 as this Example does.

SeekBar seekBar = (SeekBar)layout.findViewById(R.id.seekbar);
seekBar.setProgress(0);
seekBar.incrementProgressBy(10);
seekBar.setMax(200);

这篇关于如何使用步进值自定义搜索栏的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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