iOS 8 move UIView up when keyboard appears | Issue

前端 未结 3 409
逝去的感伤
逝去的感伤 2021-01-22 12:23

I have a UIView with a UITextField placed at the bottom of the screen which will move up when a keyboard appears.

I have been following the bel

3条回答
  •  广开言路
    2021-01-22 13:17

    Get TPKeyboardAvoidingScrollView from https://github.com/michaeltyson/TPKeyboardAvoiding

    use it as follows.

    drop the TPKeyboardAvoidingScrollView.m and TPKeyboardAvoidingScrollView.h source files into your project, pop a UIScrollView into your view controller's xib, set the scroll view's class to TPKeyboardAvoidingScrollView, and put all your controls within that scroll view. You can also create it programmatically, without using a xib - just use the TPKeyboardAvoidingScrollView as your top-level view.

    To disable the automatic "Next" button functionality, change the UITextField's return key type to anything but UIReturnKeyDefault.

提交回复
热议问题