【问题标题】:How to Create Custom PopUpView in ios8 & ios7?如何在 ios 8 和 ios 7 中创建自定义弹出视图?
【发布时间】:2015-04-18 12:48:26
【问题描述】:

我尝试在视图中创建子视图,但视图是全屏显示视图

那么任何人都可以指导我是否可以将自定义子视图作为 PopupView?

【问题讨论】:

    标签: iphone swift uiview popup uipopovercontroller


    【解决方案1】:

    您可以通过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,享受编码!

    【讨论】:

      猜你喜欢
      • 2015-01-16
      • 1970-01-01
      • 1970-01-01
      • 2015-01-24
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2015-03-22
      • 1970-01-01
      相关资源
      最近更新 更多