Android的搜索栏与拇指下方的酒吧 [英] Android SeekBar with Thumb BELOW the bar
问题描述
我想实现一个搜索栏美术团队的设计下。他们想要的不垂直居中,而下方的进度条拇指(我会张贴图片,但我没有足够的声誉还没有做到这一点)。我一直在玩一样的属性 thumbOffset
控制水平偏移,但我一直没能找到任何指示垂直偏移或填充。这样一来,我只能得到一个搜索栏,其中拇指垂直居中。
I'm trying to implement a Seek Bar following the design of the art team. They want a thumb that is not centered vertically, but rather below the progress bar (I would post a picture, but I don't have enough reputation yet to do it). I have been playing with the attributes like the thumbOffset
that controls the horizontal offset, but I haven't been able to find anything to indicate a vertical offset or padding. As a result, I'm only able to get a seek bar where the thumb is centered vertically.
我也试图扩大搜索栏,但被计算拇指位置的方法是私有的。有没有人有其他的解决方案不是实现一个全新的从头开始查找栏的组成部分?
I have also tried to extend SeekBar but the method that is calculating the thumb position is private. Does anyone have a solution other than implement a completely new seek bar component from scratch?
感谢。
推荐答案
下面有一个想法(我还没有尝试过),做一个寻求低于希望用户移动一个条,使其与<隐形code> VIEW.INVISIBLE 。然后,在无形的搜索栏的 onSeekBarChangedListener
,设置第一个可见的搜索栏的值,第二个搜索栏上。最后给出的第一个搜索栏的 setFocuseable(假)
,以便用户犯规移动寻求错误的地方吧。如果这样做没有意义或工作告诉我,我会修改/删除。
Here's an idea(I haven't tried it), make a seek bar below the one which you want the user to move, and make it invisible with VIEW.INVISIBLE
. Then, in the invisible seek bar's onSeekBarChangedListener
, set the first visible seek bar to the value that the second seek bar is on. And finally give the first seekbar the setFocuseable(false)
, so that the user doesnt move the seek bar from the wrong place. If this doesn't make sense or work tell me and I will revise/delete this.
这篇关于Android的搜索栏与拇指下方的酒吧的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!