Skip to main content
BGuth.1
Senior
September 27, 2022
Solved

How to disable slider programmatically?

  • September 27, 2022
  • 2 replies
  • 1450 views

I have a setting which can be manually or automatically adjusted/changed. A toggle button selection choses manual or automatic adjustment. Manual adjustment is done using a slider widget. When the toggle button is selected to automatic position, slider position will be adjusted programmatically based on auto adjusted value. In this case, I want slider to be disabled for manual adjustment i.e. slider head shouldn't move if attempted to slide manually. How can I achieve that?

I tried by making a grey image appear on top of slider when automatic selection is made hoping that slider will not move because this grey image is on top layer now compared to slider. Moreover, the grey image gives slider disable appearance as well. But it did not work. Please let me know.

This topic has been closed for replies.
Best answer by wired

setTouchable(false);

2 replies

wired
wiredBest answer
Senior II
September 27, 2022

setTouchable(false);

BGuth.1
BGuth.1Author
Senior
September 27, 2022

Thank you.