Seekbars - Height/Centering of thumb

Jim Brown

Active Member
Licensed User
Longtime User
Hi Erel,

One thing I struggle with when designing SeekBars is their height, to cover various themes. Currently, the middle thumb part does not scale to the seekbar height. It means I don't know what the correct height is to aim for so that the thumb part is centered in all themes. My best guess from experimenting is 32dip. Here is an example of what I mean, whereby the thumbs height is fixed (left image):

SeekBar_Centering_zps7c1560c6.png


This post points out the issue, and how to get the seekbar thumb to scale - Fixing the SeekBar thumb centering

Is there a chance you can incorporate this into B4a?
I am not sure if this works with the holo theme too though.
 
Last edited:

Computersmith64

Well-Known Member
Licensed User
Longtime User
You can use reflection to do it:
B4X:
Dim r As Reflector
r.Target = SeekBar1
r.SetField("mMaxHeight", 1000dip, "java.lang.int")

Thanks Erel! I was having the same problem. On my Galaxy S3, the SeekBar set to 30dip height looked fine, but on my Nexus 7, the thumb was "floating" above the blue line. Now it looks great on both devices!

- Colin.
 
Upvote 0
Top