UILabel has different intrinsic size on retina/non-retina devices

Originator:exsephiroth87
Number:rdar://18062963 Date Originated:19/08/2014
Status:Open Resolved:
Product:iOS Product Version:8.0
Classification:UI/Usability Reproducible:Always
 
Summary:
On a non retina device, labels always have an integral intrinsic size, while on retina device, depending on the font it might get a decimal size.

Interface Builder seems to assume that it's a retina device, and tries to enforce decimal sizes, but fails to do so correctly (e.g. can't manually set a decimal number in the size inspector), leading usually to misplaced views.

Also, this renders aligning stuff basically impossible, breaks completely existing apps layout, and will create different layouts based on pixel density.

Steps to Reproduce:
Sample code

UILabel *label = [[UILabel alloc] initWithFrame:CGRectZero];
label.text = @"Yeah";
[label sizeToFit];
NSLog(@"%f", label.frame.size.height);

Or create a label in IB, setting only top and leading constraints.

Expected Results:
The label height is the same irregardless of the device it's run on

Actual Results:
The label height is different on retina/non-retina devices

Version:
iOS8.0

Notes:


Configuration:
Any iPhone/iPad

Attachments:

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!