How To Dynamically change the contentSize of UIPopoverController?

后端 未结 8 588
执念已碎
执念已碎 2020-12-14 16:35

I have a UIViewController that contains a UITableView. This UIViewController is being displayed in a UIPopoverController.

8条回答
  •  太阳男子
    2020-12-14 17:08

    iOS8/9 solution - just override preferredContentSize and force the table view to layout prior to returning it's contentSize.

    - (CGSize)preferredContentSize {
        [self.tableView layoutIfNeeded];
        return self.tableView.contentSize;
    }
    

提交回复
热议问题