ios - xcode - how do i get all font on a view to scale depending on device? -


i trying constraints correct font size scales depending on device. seems when vertical size of uilabel shrinks scaling not happen. scaling happens when horizontal size changes. have tried fixing aspect ratio text not fit in screen vertically in case.

i text centered in gray container , scale according width of container.

this trying accomplish:

here xcode file trying modify - https://www.dropbox.com/sh/c1yx8gk2h8d1ycg/aacnsxuq2j3eiycnsmhjiqxba?dl=0

my suggestion: create custom uilabel, uibutton, uitextfield subclasses project.

in classes, can adjust font size on initialise.

use custom classes in storyboard/xib/code instead of standard.

for example uilabel

- (void)awakefromnib {     [super awakefromnib];     cgfloat fontsizemultiplier = 1;     if (isphone5) {         fontsizemultiplier = 1.1;     } else if (isphone6) {         fontsizemultiplier = 1.2;     } else if (isphone6plus) {         fontsizemultiplier = 1.35;     }     self.font = [uifont fontwithname:self.font.fontname size:self.font.pointsize * fontsizemultiplier]; } 

Comments

Popular posts from this blog

c# - Binding a comma separated list to a List<int> in asp.net web api -

Delphi 7 and decode UTF-8 base64 -

html - Is there any way to exclude a single element from the style? (Bootstrap) -