Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/ios/112.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Ios 获取UIAlertAction的大小_Ios_Cocoa Touch_Uialertcontroller_Uialertaction - Fatal编程技术网

Ios 获取UIAlertAction的大小

Ios 获取UIAlertAction的大小,ios,cocoa-touch,uialertcontroller,uialertaction,Ios,Cocoa Touch,Uialertcontroller,Uialertaction,是否有方法从UIAlertAction获取高度/宽度 它似乎不是UIView的子类,因此在UIAlertController中是否为它设置了一个常量?是的,您可以通过 present(alertController, animated: true, completion: nil) DispatchQueue.main.asyncAfter(deadline: .now() + delay) { alertController.view.frame.height } 注意:在控制器出现

是否有方法从
UIAlertAction
获取高度/宽度


它似乎不是
UIView
的子类,因此在
UIAlertController
中是否为它设置了一个常量?

是的,您可以通过

present(alertController, animated: true, completion: nil)
DispatchQueue.main.asyncAfter(deadline: .now() + delay) {
    alertController.view.frame.height
}
注意:在控制器出现后需要进行一些延迟

你真正想做什么
UIAlertController
无法自定义。我想确定其高度以计算视图中其他对象的大小。有没有关于如何获取此信息的想法?这是否只返回整个视图的警报部分(包括警报下的暗显部分)?