Issue with the Slider

10 views
Skip to first unread message

Thomas

unread,
Apr 30, 2018, 10:49:42 PM4/30/18
to CodenameOne Discussions
I am trying to create an horizontal slider with a round thumbimage. I took the default blue theme where the slider track is composed of 3 images (sliderBlueLeft.png, sliderBlueCenter.png and sliderBlueRight.png) that compose an horizontal image border. 
The problem is that this horizontal image border is drawn as the top border of the slider component instead of beeing at is center. 
I don't know if this is the expected behaviour or a bug (in the border editor of the Codename One Designer, the 3 images appear at the center of the 9 border components so I would expect them to be render at the center). 
As a consequence, my thumbimage is not centered vertically with the track of the slider but appear bellow it (the thumbimage is correctly centered at the middle of the height dimension of the slider component but the track is at the top of it): 



How can I create an horizontal slider with a thumbImage correctly centered on the track?


Shai Almog

unread,
May 1, 2018, 12:25:31 AM5/1/18
to CodenameOne Discussions
The image would need to have internal whitespace to pad it from the top so it will be better centered under the thumbnail.
So the total border image height should be identical to the thumbnail image height.
Reply all
Reply to author
Forward
0 new messages