AutoLayout with hidden UIViews?

后端 未结 13 1449
南方客
南方客 2020-11-27 09:27

I feel like it\'s a fairly common paradigm to show/hide UIViews, most often UILabels, depending on business logic. My question is, what is the best

13条回答
  •  生来不讨喜
    2020-11-27 09:59

    Subclass the view and override func intrinsicContentSize() -> CGSize. Just return CGSizeZero if the view is hidden.

提交回复
热议问题