是否可以从UIAlertAction
获取高度/宽度?
它似乎不是UIView
的子类,因此在UIAlertController
中为其设置了常量吗?
答案 0 :(得分:0)
是的,您可以通过以下方式获取UIAlertController的高度/宽度
present(alertController, animated: true, completion: nil)
DispatchQueue.main.asyncAfter(deadline: .now() + delay) {
alertController.view.frame.height
}
注意:在当前的UIAlertController之后需要放置一些延迟 You will get alert part frame only