UIScrollView - Move keyboard with touch drag like iOS 7 mail app?

后端 未结 2 1029
独厮守ぢ
独厮守ぢ 2021-01-15 04:06

I\'m curious how iOS 7 mail app is moving and dismissing the keyboard according to user\'s touch drag on new message screen.

Also it\'s implemented on comments scree

相关标签:
2条回答
  • 2021-01-15 04:43

    UIScrollView has a property called keyboardDismissMode that allows you to set different behaviours. I think this is what you want:

    scrollview.keyboardDismissMode = UIScrollViewKeyboardDismissModeInteractive;
    
    0 讨论(0)
  • 2021-01-15 04:49

    In your view controller just using [self.view endEditing:YES]; when the user taps on the view. For the drag animation you have to use CoreAnimation and gesture recognizer based on keyboard frame.

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