UILabel does not show custom fonts at runtime when size classes are used in IB
| Originator: | francis.chary | ||
| Number: | rdar://20838755 | Date Originated: | 06-May-2015 11:40 AM |
| Status: | Open | Resolved: | No |
| Product: | iOS | Product Version: | 8.3 |
| Classification: | Reproducible: | YES |
I am trying to design a UIView in Interface Builder, using a custom font. I want to set different font sizes depending on the size class. It's straightforward to do this in IB, and everything looks fine in the Storyboard/.xib, as well as in Preview. However, when the project is run on the simulator or an a device, the custom font specified is not correct. It seems to revert to a default font and default size. Steps to Reproduce: 1. Create Simple Project w/ Storyboard 2. Add custom font to project (making sure to add entry in Info.plist and ensuring that font is part of the Copy Bundle Resources Build Phase) 3. Add UILabel to storyboard in W:Any/H:Any size class mode. Change UILabel font to custom font. Change size so you know it is different from default. Observe that custom font is displayed correctly in IB. 4. Run project in simulator, observe that custom font is displayed at specified size. 5. Run project on different simulator device, observe that the font is correctly displayed. 4. Add font for W:Compact/H:Any to the UILabel in IB. Observe that both size classes have the same font size and font name defined. 5. Run project again. Expected Results: I expect to see the same thing when I run the project on the iPad Simulator as I saw in Steps 4&5. I should see the custom font displayed at the specified size. I expect to see the same custom font filling more of the screen when I run on an iPhone Simulator Actual Results: I see that the UILabel has reverted to the System Font, and what appears to be a default font size. Version: iOS 8.3 (12F69) Notes: Configuration: iOS Simulator - iPad2 and iPhone5
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!