【发布时间】:2015-04-18 12:48:26
【问题描述】:
我尝试在视图中创建子视图,但视图是全屏显示视图
那么任何人都可以指导我是否可以将自定义子视图作为 PopupView?
【问题讨论】:
标签: iphone swift uiview popup uipopovercontroller
我尝试在视图中创建子视图,但视图是全屏显示视图
那么任何人都可以指导我是否可以将自定义子视图作为 PopupView?
【问题讨论】:
标签: iphone swift uiview popup uipopovercontroller
您可以通过AlertViewController 完成。
这是我的忘记密码方法,您可以从中获得帮助。
@IBAction func forgotpwd(sender: AnyObject) {
let alertController = UIAlertController(title: "Forgot Password", message: "Enter Your Email.", preferredStyle: .Alert)
alertController.addTextFieldWithConfigurationHandler { (textField) in
textField.placeholder = "Enter your Email"
textField.keyboardType = .EmailAddress
}
var yesAction = UIAlertAction(title: "YES", style: UIAlertActionStyle.Default) {
UIAlertAction in
//Do you Success button Stuff here
}
var noAction = UIAlertAction(title: "NO", style: UIAlertActionStyle.Cancel) {
UIAlertAction in
//Do you No button Stuff here, like dismissAlertView
}
alertController.addAction(yesAction)
alertController.addAction(noAction)
self.presentViewController(alertController, animated: true) {
}
}
希望对你有帮助,
HTH,享受编码!
【讨论】: