开发者

How to make keyboard with textfield on the top of it?

开发者 https://www.devze.com 2023-03-24 12:28 出处:网络
I need to have textfield (maybe with button) fixed at the bottom of screen, and when start editing, I want it (and probably the whole view) to 开发者_StackOverflow社区move with keyboard up - just like

I need to have textfield (maybe with button) fixed at the bottom of screen, and when start editing, I want it (and probably the whole view) to 开发者_StackOverflow社区move with keyboard up - just like in the native Messages application (or Whatsapp, etc...). Any suggestions ?


The easiest way is to put everything in a UIScrollView, which you resize when the keyboard is shown using the UIKeyboardDidShowNotification. Then you scroll to ensure that your views are visible.

Check out the Apple documentation under "Moving Content That Is Located Under the Keyboard"

0

精彩评论

暂无评论...
验证码 换一张
取 消