如何在iOS中为各种iPhone屏幕尺寸调整字体大小? [英] How to adjust font size for various iPhone screen sizes in iOS?

查看:168
本文介绍了如何在iOS中为各种iPhone屏幕尺寸调整字体大小?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个专为5s设计的应用程序,字体大小为13px.但是当在iPhone6 Plus中运行相同字体时,字体看起来很小.尽管由于基于百分比的元素位置和布局,元素的位置和大小正在根据大小进行相应调整.

I have an app designed for 5s with a font size of 13px. But when the same is run in iPhone6 Plus font is looking very tiny. 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 ?

推荐答案

此处是如何为不同设备自定义字体的示例(本教程末尾的Adaptive Fonts部分)

Here is an example of how you can customize font for different devices (section Adaptive Fonts almost in the end of tutorial)

简短说明如何执行此操作:

  1. 在Interface Builder中选择标签

  1. Select label in Interface Builder

在字体"附近按+按钮,然后选择要使用其另一种字体的设备大小

Press + button near Font and select device size, for which you want to have another font

为该设备设置新字体

这篇关于如何在iOS中为各种iPhone屏幕尺寸调整字体大小?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆