How do I adjust my content views so that they are not obscured by the keyboard?

元气小坏坏 提交于 2020-03-25 17:36:41

问题


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?


回答1:


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.

Hope this helps !




回答2:


I usually move up my whole UIView so you can see both keyboard and textfield



来源:https://stackoverflow.com/questions/3564420/how-do-i-adjust-my-content-views-so-that-they-are-not-obscured-by-the-keyboard

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!