按屏幕尺寸缩放文本标签
是否有一种缩放文本的方式,以便无论设备大小如何,文本都可以占据相同的屏幕空间?我发现,与iPhone相比,iPad尺寸的设备上的文字相对于屏幕尺寸而言太小.以下是我要寻找的示例.请注意,文本百分比大小与设备屏幕大小类似.
Is there a way to scale text so that it takes up close to the same screen real estate no matter what the device size is? I've found that the text on an iPad sized device is too small in relation to the screen size when compared to the iPhone. Below is an example of what I'm looking for. Notice the text percentage size is similar in relation to the device screen size.
To set constraints on the label that you have, see this link: How do you make a background image scale to screen size in swift? . I know that you might not be using Swift (I'm using Objective-C), but the first answer shows how to do it in the storyboard. Do the same thing it says, but for the label. Then, see the image below to change the auto shrink options for the label from "Fixed Font Size" to "Minimum Font Scale" (see image below). Hope this helps!