gpt4 book ai didi

ios - self.view.bounds.maxY 仅适用于 viewDidLoad() 之外

转载 作者:行者123 更新时间:2023-11-29 05:47:00 24 4
gpt4 key购买 nike

我正在尝试使用

调整自定义键盘扩展的大小
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/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com