how to make UILabel autosize text in storyboard (or interface builder), NOT programmatically

后端 未结 4 1849
再見小時候
再見小時候 2021-02-03 17:04

Every time I click-and-drag a UILabel to storyboard, and then add text to Text field, the text is cut off, so I then have to click-and-drag the UILabel to stretch it big enough

4条回答
  •  眼角桃花
    2021-02-03 17:25

    On any element in Interface Builder you can select the element and hit...

    Editor > Size to Fit Content (keyboard shortcut: CMD+=)

    This will do a "sizeToFit" on the selected element. Labels will fit their text size, image view will resize to the image size, etc...

提交回复
热议问题