简体   繁体   English

如何在iOS中为各种iPhone屏幕尺寸调整字体大小?

[英]How to adjust font size for various iPhone screen sizes in iOS?

I have an app designed for 5s with a font size of 13px. 我有一个为5s设计的应用程序,字体大小为13px。 But when the same is run in iPhone6 Plus font is looking very tiny. 但是当在iPhone6 Plus中运行相同字体时,字体看起来很小。 Although position and size of the elements is adjusting accordingly to the size thanks to percentage based element position and layout. 尽管由于基于百分比的元素位置和布局,元素的位置和大小正在根据大小进行相应调整。

Any idea on how to change the font according to screen size ? 关于如何根据屏幕大小更改字体的想法吗?

Here is an example of how you can customize font for different devices (section Adaptive Fonts almost in the end of tutorial) 是一个如何为不同设备自定义字体的示例(教程结尾处的自适应字体一节)

Short instruction how to do this: 简短说明如何执行此操作:

  1. Select label in Interface Builder 在Interface Builder中选择标签 在此处输入图片说明

  2. Press + button near Font and select device size, for which you want to have another font 按字体旁边的+按钮,然后选择要使用其另一种字体的设备大小 在此处输入图片说明

  3. Set new font for that devices 为该设备设置新字体 在此处输入图片说明

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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