简体   繁体   中英

UITableViewAutomaticDimension is working but how do I get the frame Size the autolayout set it to?

My Question might sound strange but somehow I need to ask this. So I have UITableViewAutomaticDimension set on my both Section Header and Rows which is working like a charm. But somehow I am playing with constraints which changes my Section Header dynamically(The whole frame and constraints NOT Content when the Table scrolls. IS there a way to get the size or frame that was set to my Section Header while using UITableViewAutomaticDimension

I am not looking for suggestions like why should I not change my constraints at run time. Please help if I can find the auto-layout size set to the headers after my table was loaded.

You can look at the bounds of the view in tableView(_ tableView: UITableView, willDisplayHeaderView view: UIView, forSection section: Int) from UITableViewDelegate and that will be the size that the automatic dimension calculated. Same goes for cells in tableView(_ tableView: UITableView, willDisplay cell: UITableViewCell, forRowAt indexPath: IndexPath) .

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM