0
的iPhone与众不同我希望我的iphone警惕看起来像iPad这样的警报警报显示出比iPad上
代码:
let alertController = UIAlertController(title: "Appcoda", message: "Message in alert dialog", preferredStyle: UIAlertControllerStyle.ActionSheet)
let deleteAction = UIAlertAction(title: "Delete", style: UIAlertActionStyle.Destructive, handler: {(alert :UIAlertAction) in
print("Delete button tapped")
})
alertController.addAction(deleteAction)
let okAction = UIAlertAction(title: "OK", style: UIAlertActionStyle.Default, handler: {(alert :UIAlertAction) in
print("OK button tapped")
})
alertController.addAction(okAction)
alertController.popoverPresentationController?.sourceView = view
alertController.popoverPresentationController?.sourceRect = sender.frame
presentViewController(alertController, animated: true, completion: nil)
我可以添加到代码什么上面有iPhone的警报看起来像iPad的警报?
因为小屏幕面积,苹果选择在底部显示UIAlertView中。 –
您需要[自定义UIAlertView](http://stackoverflow.com/search?q=ios+custom+UIAlertView) –