如何在 ios8 和 ios7 中创建自定义 PopUpView?
How to Create Custom PopUpView in ios8 & ios7?
我尝试在视图中创建子视图,但视图是获取全屏当前视图
谁能指导我是否可以将子视图自定义为 PopupView?
您可以通过 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,享受编码吧!
我尝试在视图中创建子视图,但视图是获取全屏当前视图
谁能指导我是否可以将子视图自定义为 PopupView?
您可以通过 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,享受编码吧!