How do I set the height of tableHeaderView (UITableView) with autolayout?

后端 未结 12 1245
后悔当初
后悔当初 2020-11-27 10:23

I\'m been smashing my head against the wall with this for last 3 or 4 hours and I can\'t seem to figure it out. I have a UIViewController with a full screen UITableView insi

12条回答
  •  抹茶落季
    2020-11-27 10:49

    You need to use the UIView systemLayoutSizeFittingSize: method to obtain the minimum bounding size of your header view.

    I provide further discussion on using this API in this Q/A:

    How to resize superview to fit all subviews with autolayout?

提交回复
热议问题