Scale text label by screen size

前端 未结 7 1321
长情又很酷
长情又很酷 2020-12-08 10:13

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

7条回答
  •  北海茫月
    2020-12-08 10:39

    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!

    Changing Font Size

提交回复
热议问题