[英]How to set different Font sizes for different iPhone screen size using storyboard?
I have a title in my screen whose font size is 16 but in iPhone 5s/4s it looks slightly bigger, so I want to adjust font size based on different iPhone screen size. 我的屏幕上有一个标题,其字体大小为16但在iPhone 5s / 4s中它看起来略大,所以我想根据不同的iPhone屏幕尺寸调整字体大小。 Is it possible via storyboard? 是否可以通过故事板?
yes, you can ask iOS to adapt automatically, BUT using Apple directions. 是的,您可以要求iOS自动适应,但使用Apple方向。 By the way apple states: (since ios7) 顺便说一下苹果说:(自ios7起)
https://developer.apple.com/ios/human-interface-guidelines/visual-design/typography/ https://developer.apple.com/ios/human-interface-guidelines/visual-design/typography/
1) "Use built-in text styles whenever possible." 1)“尽可能使用内置文本样式。” (algorithm is form apple..) (算法是形式苹果..)
2) "Dynamic Type provides additional flexibility by letting readers choose their preferred text size." 2)“动态类型通过让读者选择他们喜欢的文本大小来提供额外的灵活性。”
So Apple has already took in account all variations on devices and fonts and user preferences. 因此,Apple已经考虑了设备,字体和用户偏好的所有变化。 (maybe is NOT what you want.. but is the official way to scale / adapt fonts) (也许不是你想要的......但是缩放/调整字体的官方方式)
By using xCode you can give dynamic font like this way check bellow image 通过使用xCode,你可以像这样给动态字体检查波纹管图像
Setup Font 设置字体
After setting up 设置完成后
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.