如何调整内容视图,使它们不会被键盘遮盖? [英] How do I adjust my content views so that they are not obscured by the keyboard?

查看:59
本文介绍了如何调整内容视图,使它们不会被键盘遮盖?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当键盘在我的iPhone应用程序中向上滑动时,它会遮挡屏幕的很大一部分。我该如何调整视图以使其不隐藏在键盘下?

When the keyboard slides up in my iPhone application, it obscures a large portion of the screen. How do I adjust my views so that they are not hidden under the keyboard?

推荐答案

您会为该视图找到漂亮的代码<请参见href = http://developer.apple.com/iphone/library/documentation/StringsTextFonts/Conceptual/TextAndWebiPhoneOS/KeyboardManagement/KeyboardManagement.html rel = nofollow noreferrer>此处。
只需转至以下部分:移动位于键盘下方的内容

You'll find nice code for that here. Just go to the section called : Moving Content That Is Located Under the Keyboard

您可以使用和修改文档中所述的内容在键盘可见时移动视图。

You can use and adapt what the documentation said to move your view when the keyboard is visible.

希望这会有所帮助!

这篇关于如何调整内容视图,使它们不会被键盘遮盖?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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