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

相關問題