iPhone - 键盘隐藏TextField [英] iPhone - Keyboard hides TextField

查看:134
本文介绍了iPhone - 键盘隐藏TextField的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用UITextField来接收用户输入。但是,由于我的文本字段朝向笔尖的中间/底部,因此当键盘弹出时会隐藏它。有没有什么方法可以将它与键盘一起滑动,以便在选择时它位于键盘的顶部?此外,既然我也在使用数字键盘,是否有一种简单的方法可以在某处包含完成按钮?

I am using UITextField to receive user inputs. However, since my textfields are towards the middle/bottom of the nib, it gets hidden when the keyboard pops up. Is there any way sort of slide it along with the keyboard so that it's on the top of the keyboard during selection? Also, since I am also using the numberpad, is there an easy way to include a done button somewhere?

感谢您的帮助。

推荐答案

要在键盘出现时滚动,我喜欢本教程来自Cocoa With Love。

To scroll when the keyboard appears, I like this tutorial from Cocoa With Love.

要关闭数字键盘,你可以在键盘上放置一个自定义的完成按钮或者在屏幕的其余部分做一个隐形按钮。我用代码完成了后者,但本教程使用Interface Builder。

To dismiss the number keypad, you can put a custom "Done" button on the keypad or make an invisible button over the rest of the screen. I have done the latter with code, but this tutorial uses Interface Builder.

这篇关于iPhone - 键盘隐藏TextField的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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