2015-10-15 79 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) –

回答