我正在尝试使用
调整自定义键盘扩展的大小self.view.bounds.maxY
但是,该代码似乎只能在
之外工作viewDidLoad()
在保存 View 的高度后,有没有办法再次通过 viewDidLoad ?
除了使用通知之外,还有其他方法获取键盘矩形的高度吗?
最佳答案
您可以使用 UIScreen.main.bounds.height
,它与 self.view.bounds.maxY
相同,假设它是全屏 VC ,否则在内部访问它viewDidLayoutSubviews
Is there a way to go through viewDidLoad again after I have saved the height of my view?
是的,你可以,但调用应该由系统调用的方法不是一个好主意
Is there another way to get the height of the keyboard rectangle other than using the notifications?
没有
关于ios - self.view.bounds.maxY 仅适用于 viewDidLoad() 之外,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/56047906/