两个UITextFields-先将键盘滑出,然后再滑入 [英] two UITextFields - slide first Keyboard out and next in
问题描述
所以在我的视图加载中,我得到了类似的东西
so in my viewdidload i got something like
[nameTextField becomeFirstResponder]
现在单击按钮后,我想滑出该文本字段的键盘,并滑入另一个文本字段的另一个键盘.
now after a button gets klicked, i want to slide out the keyboard of this textfield, and slide another keyboard of another textfield in.
我考虑过
[nameTextField resignFirstResponder];
[dateTextField becomeFirstResponder];
但另一个键盘会立即显示.
but the other keyboard shows up immediately.
对[dateTextField becomeFirstResponder];
进行注释,效果是我的nameTextField键盘可以按我的意愿滑出.
commenting the [dateTextField becomeFirstResponder];
out, effects that my nameTextField keyboard slides out as i wanted.
任何想法如何做到这一点?
any ideas how to do this?
谢谢!
推荐答案
您是否有这样做的理由?显然,这将增加用户输入信息所需的时间,而我知道这会惹恼我.
Is there a reason why you want to do this? It will obviously increase the time it takes for a user to enter information, which I know would bug me.
但是,如果您确实想要这种效果,那么我会看这样的事情:
But if you do really want this effect, then I would look at something like this:
[dateTextField performSelector:@selector(becomeFirstResponder) withObject:nil afterDelay:timeDelay];
timeDelay
是关闭第一个键盘所花费的时间.
Where timeDelay
is the amount of time it takes to dismiss the first keyboard.
这篇关于两个UITextFields-先将键盘滑出,然后再滑入的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!