UIButton intrinsic content size doesn't match UIButtonLabel intrinsic content size
| Originator: | kylepetrovich | ||
| Number: | rdar://19444213 | Date Originated: | 1/12/15 |
| Status: | Closed | Resolved: | Duplicate of 19541115 |
| Product: | iOS | Product Version: | 8.1.2 |
| Classification: | Other Bug | Reproducible: | Yes |
Summary: If you have a button constrained to a certain width, with word wrap on, and you give it a title which causes the button to wrap, then the button's UIButtonLabel will wrap correctly and grow in height, but the button itself will not change size. This causes misleading click targets, and possible overflows if you are spacing your button with other content via autolayout. Steps to Reproduce: 1.) Make a UIButton in interface builder. 2.) Constrain it's left and right edges to some other interface element. 3.) Set UIButton to word wrap. 4.) Set title of button to more than 1 line's worth of text. Expected Results: Expected to see button label wrap (in this case growing in height) and the button increases in size to encompass it's label. Actual Results: The button label wraps and grows in height, but the button itself remains the same height. Capturing view hierarchy confirms that the button is smaller than it's corresponding label. Version: iOS 8.1.2 (12B440)
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!