Moving keyboard when editing multiple textfields with constraints swift

后端 未结 1 682
既然无缘
既然无缘 2021-01-16 18:14

I have UIViewController which looks like this:

I set all the relevant constraints.

I\'m trying to shift the UIView

相关标签:
1条回答
  • 2021-01-16 18:39

    You must use scrollview for your uiview controller and then you can use notification for adjusting your uiview constraint.

    Your UIViewController hierarchy should be like this

    ContainerView --> ScrollView --> Content View --> Now Your View.

    I'm suggesting you to use pod 'TPKeyboardAvoiding' for future animations in scrollview since for every controller you don't want to put notifications to shifting your UIView.

    Here is link demo for your UIView shifting https://github.com/Vasu05/ScrollViewExample

    0 讨论(0)
提交回复
热议问题