How can I add padding to the intrinsic content size of UILabel?

前端 未结 4 513
南笙
南笙 2021-02-04 02:09

I\'m using autolayout on iOS7 and I have a problem like this:

I\'m putting a UILabel onto a UIView and I\'m arranging my autolayout constraints so that the label\'s cen

4条回答
  •  旧时难觅i
    2021-02-04 02:35

    If you are trying to give the UILabel a different colour to its parent view, then you will need to enclose the UILabel in a UIView with the padding and the background colour you want. If your UILabels background colour is the same as its parent view, then I don't understand the problem just use auto layout to specify how much space you want relative to the thing it is next to.

提交回复
热议问题