有没有办法从UIAlertAction中获取高度/宽度
它似乎不是UIView的子类,因此在UIAlertController中是否有为其设置的常量
发布于 2019-04-17 15:59:17
是的,您可以通过以下方式获取UIAlertController的高度/宽度
present(alertController, animated: true, completion: nil)
DispatchQueue.main.asyncAfter(deadline: .now() + delay) {
alertController.view.frame.height
}注:需要在present UIAlertController You will get alert part frame only之后添加一些延迟
https://stackoverflow.com/questions/54678530
复制相似问题