2015-10-15 37 views
0

的iPhone与众不同我希望我的iphone警惕看起来像iPad这样的警报警报显示出比iPad上

enter image description here

代码:

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的警报?

+0

因为小屏幕面积,苹果选择在底部显示UIAlertView中。 –

+0

您需要[自定义UIAlertView](http://stackoverflow.com/search?q=ios+custom+UIAlertView) –

回答