Keeping object on top of keyboard in the event of becomeFirstResponder or resignFirstResponder?

前端 未结 4 2082
感情败类
感情败类 2020-11-28 05:05

I currently have a UITextField on top of a keyboard. When you tap it, it should stick on top of the keyboard and move up smoothly. I don\'t know the exact duration and anima

4条回答
  •  独厮守ぢ
    2020-11-28 05:44

    in order to make the UITextField to dock to keyboard (with animation), you need to do offset calculations and apply offset changes on the scroll view (assuming UITextField is placed in UIScrollView) using setContentOffset:animation: method.

提交回复
热议问题