[英]How can I change the height of UITextField in UIAlertController in Swift?
[英]Can we change the height and width of UIAlertController Buttons in swift
请尝试以下代码:-
////更改警报视图控制器的高度
*
let alertController = UIAlertController(title: nil, message: "hello", preferredStyle: .Alert)
let cancelAction = UIAlertAction(title: "Cancel", style: .Cancel) { (action) in
// hide action sheet
}
alertController.addAction(cancelAction)
var height:NSLayoutConstraint = NSLayoutConstraint(item: alertController.view, attribute: NSLayoutAttribute.Height, relatedBy: NSLayoutRelation.Equal, toItem: nil, attribute: NSLayoutAttribute.NotAnAttribute, multiplier: 1, constant: self.view.frame.height * 0.80)
alertController.view.addConstraint(height);
self.presentViewController(alertController, animated: true, completion: nil)
*
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.