我如何能迫使我的键盘在我的程序启动的Swift?

时间:2021-12-02 00:22:59

I want the keyboard to go up as the app is starting and starting typing into the text field that I have.

我想让键盘在应用程序开始并开始输入我的文本框时向上移动。

1 个解决方案

#1


2  

In your viewDidLoad method, add the following:

在viewDidLoad方法中,添加以下内容:

txtField1.becomeFirstResponder()

For more information about UIResponder's becomeFirstResponder(), check the documentation.

有关UIResponder的成为firstresponder()的更多信息,请检查文档。

#1


2  

In your viewDidLoad method, add the following:

在viewDidLoad方法中,添加以下内容:

txtField1.becomeFirstResponder()

For more information about UIResponder's becomeFirstResponder(), check the documentation.

有关UIResponder的成为firstresponder()的更多信息,请检查文档。