是否有一个聆听功能可让您在顶部弹出横幅时调整视图的布局? (即表示"触摸返回电话","录制","地图使用您的位置"等等的横幅)
答案 0 :(得分:0)
应该调用您的viewWillLayoutSubviews()
方法。您可以根据视图边界相应地覆盖和调整视图。更多信息在这里
https://developer.apple.com/reference/uikit/uiviewcontroller/1621437-viewwilllayoutsubviews
Swift代码:
override func viewWillLayoutSubviews() {
super.viewWillLayoutSubviews()
// Use self.view.bounds to do what you want to
}
目标C代码:
- (void)viewWillLayoutSubviews {
[super viewWillLayoutSubviews];
// use self.view.bounds to do what you want to
}