0

这是关于迅速?当我在swift中点击UITextField时,为什么不显示UIKeyboard?

我已经建立了一个没有任何连接到另一个控制器,但它使用它的故事板ID实例化。

关联的类文件:

import Foundation 
import UIKit 

class SignUpViewController : UIViewController, UITextFieldDelegate { 
    @IBOutlet weak var companyField: UITextField! 
    @IBOutlet weak var emailField: UITextField! 
    @IBOutlet weak var passwordField: UITextField! 


    override func viewDidLoad() { 
     super.viewDidLoad() 
    } 

    override func viewDidAppear(animated: Bool) { 
     super.viewDidAppear(animated) 

    } 


    @IBAction func loginButtonTapped(sender: UIButton) { 

    } 

    @IBAction func forgotPasswordButtonTapped(sender: UIButton) { 
    } 


    @IBAction func signUpButtonTapped(sender: UIButton) { 
    } 

} 

这就是我目前的注册控制器:

@IBAction func signUpButtonTapped(sender: UIButton) { 
    let signUpViewController = self.storyboard?.instantiateViewControllerWithIdentifier("signUpViewControllerSB") as SignUpViewController 

    self.presentViewController(signUpViewController, animated: true, completion: nil) 
} 

我点击任何文本字段,并获得闪动的光标,但没有键盘出现。

我错过了什么?

在swift之前,我可以只添加textfields,运行模拟器和键盘会弹出。

我确信我已经做好了一切准备。

回答

2

检查这些设定]中以 iPhone模拟器 - >硬件 - >键盘 - >切换软件键盘

iPhone模拟器 - >硬件 - >键盘 - >取消选中Connect Hardware Keyboard

+0

这工作。我必须意外地禁用它一些方法。 – LondonGuy 2014-09-04 13:41:55

相关问题