我正在用 Swift 编写一个针对 iOS 8 的应用程序。有谁知道是否可以通过编程方式定位通过 UIAlertController 显示的警报? ?该文档没有提及位置或位置,因此我尝试将 Controller 的 view.frame 属性设置为新的 CGRect,但警报仍然出现在死点。
请您参考如下方法:
根据设计,警报 View 显示在正中央。这是因为这种体验旨在让最终用户熟悉且简单。在 UIAlertController 的文档中,它还指出:
The view hierarchy for this class is private and must not be modified.
如果您希望操纵框架的放置,您有几个使用普通旧 UIView/UIViewController 的选项。这是我用过的一个用 swift 写的,你可以做你想做的事:https://github.com/vikmeup/SCLAlertView-Swift
