iOS 14 - UISlider not updating appearance when enabled

Hi.

Has anyone else noticed any issues under iPadOS 14 (including beta 6) when updating the .enabled state of a UISlider on the main thread?

I’m seeing a problem in my app where the slider is usable, but is still showing the disabled state. The relevant statement to enable the slider is definitely being executed (breakpoints are being hit, etc.) and the code in question works correctly on iOS 9.x thru 13.x, so the issue appears to be confined to iOS 14.

Thanks in advance.
Answered by CrusherWu in 630167022
I also encounter the same problem. May be it's system's bug. BUT I try to fix it as below:
Code Block
slider.selected = YES;
[slider layoutIfNeeded];


It works.
I'm seeing the same thing. I think this is because UISlider is partially transparent even when enabled.
+1 on this.
In "Dark" mode, the visual appearance in both states look exactly the same. I was hoping for at least some greying of the bar, but its the standard blue tint in both cases.
Accepted Answer
I also encounter the same problem. May be it's system's bug. BUT I try to fix it as below:
Code Block
slider.selected = YES;
[slider layoutIfNeeded];


It works.
Did you file a bug report ?
I face the same bug in iOS 14 final. What worked for me was to set the view needs layout and call layoutIfNeeded afterwards.

Code Block
slider.setNeedsLayout()
slider.layoutIfNeeded()

layoutSubviews() fixes the issue, but it definitely looks like a bug (iOS 14.4.1).

in IOS15 UISlider setNeedsLayout() works.

iOS 14 - UISlider not updating appearance when enabled
 
 
Q