iPhone - 键盘隐藏文本字段

iPhone - Keyboard hides TextField(iPhone - 键盘隐藏文本字段)
本文介绍了iPhone - 键盘隐藏文本字段的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

问题描述

我正在使用 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.

要关闭数字键盘,您可以 在键盘上放置一个自定义的完成"按钮或在屏幕的其余部分制作一个不可见的按钮.我已经用代码完成了后者,但是 本教程 使用界面生成器.

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 - 键盘隐藏文本字段的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

本站部分内容来源互联网,如果有图片或者内容侵犯了您的权益,请联系我们,我们会在确认后第一时间进行删除!

相关文档推荐

Hardware Volume buttons change in app volume(硬件音量按钮更改应用程序音量)
Cocos2d - How to check for Intersection between objects in different layers(Cocos2d - 如何检查不同层中对象之间的交集)
Highlight Read-Along Text (in a storybook type app for iPhone)(突出显示朗读文本(在 iPhone 的故事书类型应用程序中))
Cocos2D + Disabling only Retina iPad Graphics(Cocos2D + 仅禁用 Retina iPad 图形)
Proper cocos2d scene restart?(正确的 cocos2d 场景重启?)
[ios.cocos2d+box2d]how to disable auto-rotation?([ios.cocos2d+box2d]如何禁用自动旋转?)