Vertically Align UILabel text with constraints and no wrap (auto layout, single line)

前端 未结 4 1643
深忆病人
深忆病人 2021-02-05 13:19

So I have my view setup in IB such that this text label aligns with the top of the thumbnail via constraints.

\"ente

4条回答
  •  旧时难觅i
    2021-02-05 13:23

    TomSwift thanks for your answer, i really struggled with this issue.

    If someone is still getting weird behaviour, i had to change:

    intrinsicContentSize = CGSizeMake( inaccurateSize.width, accurateHeight);

    to

    intrinsicContentSize = CGSizeMake( inaccurateSize.width, accurateHeight * 2);

    then it worked like charm.

提交回复
热议问题