首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >获取UIAlertAction的大小

获取UIAlertAction的大小
EN

Stack Overflow用户
提问于 2019-02-14 04:02:54
回答 1查看 53关注 0票数 1

有没有办法从UIAlertAction中获取高度/宽度

它似乎不是UIView的子类,因此在UIAlertController中是否有为其设置的常量

EN

回答 1

Stack Overflow用户

发布于 2019-04-17 15:59:17

是的,您可以通过以下方式获取UIAlertController的高度/宽度

代码语言:javascript
复制
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之后添加一些延迟

票数 -1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/54678530

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档