UISlider does not respect semanticContentAttribute value (RTL language support)
| Originator: | tobias.conradi.hh | ||
| Number: | rdar://22897614 | Date Originated: | 29-Sep-2015 06:24 PM |
| Status: | Open | Resolved: | |
| Product: | iOS | Product Version: | 9.0.1 (13A404) |
| Classification: | UI/Usability | Reproducible: | Always |
Summary: UISlider does not respect the value of semanticContentAttribute. Regardless of the semanticContentAttribute the slider has has LTR semantic when running with LTR language locale and RTL semantic when running with RTL language locale. Steps to Reproduce: 1. Add localization for an RTL language (e.g. Arabic). 2. Configure sliders with playback semantic (UISemanticContentAttributePlayback, the slider should keep LTR direction even when running with RTL language locale). 3. Run app with Arabic application language or RTL pseudolanguage scheme configuration. Expected Results: The slider respects the playback semantic and appears LTR oriented. Actual Results: The slider appears in RTL semantic. Notes: Sample project with a slider with each UISemanticContentAttribute and screenshots of it running in RTL and LTR mode are attached..
Comments
Please note: Reports posted here will not necessarily be seen by Apple. All problems should be submitted at bugreport.apple.com before they are posted here. Please only post information for Radars that you have filed yourself, and please do not include Apple confidential information in your posts. Thank you!
This problem only exists for sliders that are created and configured in InterfaceBuilder. A workaround is to set the semanticContentAttribute to UISemanticContentAttributeUndefined and back to the previously configured value. Directly setting the same value does not work as the _viewFlags are only updated when the semanticContentAttribute changed.
Example workaround: - (void) awakeFromNib { UISlider *slider = self.positionSlider; if ([slider respondsToSelector:@selector(semanticContentAttribute)]) { UISemanticContentAttribute attribute = slider.semanticContentAttribute; slider.semanticContentAttribute = UISemanticContentAttributeUnspecified; slider.semanticContentAttribute = attribute; } }
Sample project and screenshots
https://github.com/toco/radars/tree/master/UISliderRTL