简体   繁体   中英

iOS 9 issue regarding font size

i am searched in stackoverflow, regarding font problems in ios 9, but nothing to any related solution, so, i am post this question.

Question: I am using UIStoryBoard to design a page, in this page i have using labels, textfields and extra... , my problem is I have provide "system font size XX" to labels and text fields text (Here i am using XCode 6.3 and iOS 8), and run in iOS 8 Devices its display exact design(means, the what i am design in storyboard). but i am run in iOS 9 its font size increases, what the problem.

==> In iOS 8 device, the Label text is displayed exactly what i am design

For example [] --> let, this is label , here i am design like this,

" [2015]  "

Size of Label is: 55 Label text font size : system 17

==> In iOS 9, Here missing the content like this,

 " [20...]  "

Size of Label is: 55 Label text font size : system 17

So, i am thinking Label font size is increased.

please, suggest any solutions or fixes.

Thanks.

iOS9 now has a new System Font called "San Francisco"

I believe your labels are only fitting for the previous system font "Helvetica", so your labels are truncating the tail.

You can fix this by setting the minimum font size in Interface Builder or via code as such:

let label = UILabel() label.minimumScaleFactor = 10.0/12.0

You can find more informtion on the new iOS9 system font here: https://developer.apple.com/fonts/

It seems that the font in iOS9 is bigger. If you dont't want to change the font size or set minimumScaleFactor, you can change label.adjustsFontSizeToFitWidth = YES. But you'd better put it at last of label creation code just before you add the label to some view

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM