gpt4 book ai didi

iphone - 如何在 ios 8 和 ios 7 中创建自定义弹出 View ?

转载 作者:行者123 更新时间:2023-11-30 10:16:29 24 4
gpt4 key购买 nike

我尝试在 View 内创建 subview ,但 View 获得全屏当前 View

i Want to create this type of view in subview. i want to customised this Subview as PopUp vIew.as my below Screen shot show.

那么有人可以指导我是否可以将 subview 自定义为 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,享受编码的乐趣!!

关于iphone - 如何在 ios 8 和 ios 7 中创建自定义弹出 View ?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/29717560/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com