UIImage in UIButton not respecting size class rules
| Originator: | JacobSyndeo | ||
| Number: | rdar://22593495 | Date Originated: | 05-Sep-2015 |
| Status: | Open | Resolved: | |
| Product: | iOS | Product Version: | 9 |
| Classification: | UI/Usability | Reproducible: | Always |
Attachment: http://www.mediafire.com/download/7hr9bf8h085osvx/SizeClassBug.zip Summary: When a UIImage is inside of a UIButton is replaced with another image file (due to a size class change, for example, an iPhone entering landscape/compact height), and THEN the button's selected state is changed (if it gets switched from selected to deselected or vice versa), the size class is no longer respected. I've attached a sample project that demonstrates this. It's a very watered-down version of a view controller in my own app where I'm experiencing this same issue. Steps to Reproduce: 1. Launch the sample app on an iPhone. I've tested it on the latest iOS 9 beta (build 13A4325c) and the iOS simulator. 2. Tap the play/pause button a few times or so, it switches just as you'd expect it to, showing the proper images for the normal size class. 3. Rotate the device sideways. The image is properly replaced with its larger copy as defined in the asset catalog. (I've marked the larger images yellow so that we can differentiate while debugging, and to make sure that the system isn't just scaling it up.) 4. Tap the play/pause button now. Expected Results: The button's image should stay at the proper size class (marked with yellow for easy identification during debugging) Actual Results: The button's image switches to the Regular size class (the white one), even when the device is sideways (compact size class, should show our yellow one) Version: iOS 9.0 [13A4325c] (on both device and simulator) Notes: Configuration: iPhone 6, iOS Simulator
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!