如何在编辑时更改returnKeyType? [英] How do I change returnKeyType while editing?

查看:72
本文介绍了如何在编辑时更改returnKeyType?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何在编辑时更改iPhone上的返回键。我知道

How can I change the return key on the iPhone while it is editing. I know about

myTextField.returnKeyType = UIReturnKeySearch;

但是,这仅在我调用 [myTextField resignFirstResponder]时才有效; 然后 [myTextField becomeFirstResponder]; 隐藏键盘然后将其带回来。否则,它只是保持我以前的那个,在这种情况下它是Go。我需要根据用户输入的字符继续切换它们。

However, this only works if I call [myTextField resignFirstResponder]; then [myTextField becomeFirstResponder]; which hides the keyboard then brings it back. Otherwise, it just stays as the one I had before, in this case it was "Go". I need to keep switching them depending on the characters the user enters.

在一行中:如何更改退货键盘的键盘类型还在编辑时?

In one line: How do I change the return key type of the keyboard while it is still editing?

推荐答案

[textField reloadInputViews] 好像有把戏......

[textField reloadInputViews] seems to do the trick...

这篇关于如何在编辑时更改returnKeyType?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆