如何调整内容视图,使它们不会被键盘遮盖? [英] How do I adjust my content views so that they are not obscured by the keyboard?
问题描述
当键盘在我的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屋!