Keyboard Scroll on Active Text Field - Scrolling to Out of View?

前端 未结 4 2039
庸人自扰
庸人自扰 2020-12-13 16:35

I have an application with a view that has text fields from the top of the view to the bottom of the view. I needed it to scroll when editing the bottom fields so that the f

4条回答
  •  既然无缘
    2020-12-13 17:01

    Since I found it, I use TPKeyboardAvoiding

    It is working great, and is very easy to setup:

    1. Add a UIScrollView into your view controller's xib
    2. Set the scroll view's class to TPKeyboardAvoidingScrollView (still in the xib, via the identity inspector)
    3. Place all your controls within that scrollview

    It also automatically hooks up "Next" buttons on the keyboard to switch through the text fields.

    Good luck!

提交回复
热议问题