iOS 键盘躲避库:MLInputDodger
jopen
9年前
iOS耦合性很低的通用快速实现键盘躲避的库.
- (void)viewDidAppear:(BOOL)animated { [super viewDidAppear:animated]; self.view.shiftHeightAsDodgeViewForMLInputDodger = 50.0f; [self.view registerAsDodgeViewForMLInputDodger]; }
Then the subviews who can becomeFirstResponder will trigger dodge.
If you need custom shiftHeight for special responder, just set theshiftHeightAsFirstResponderForMLInputDodgerproperty.