KeyboardHandler 是一个让人愉悦的库,帮您轻松处理多个 UITextField 和键盘。它支持将 UITextField 包装在 UIViewController、UINavigationController、UITabBarController,甚至是 UIView 中。
这里是演示:下载 KeyboardHandler
platform :ios, '7.0'
pod "KeyboardHandler", "~> 0.0.1"
handleWithView
。@interface Demo () {
KeyboardHandler *keyboardHandler; // or declare as a property variable
}
@property (strong, nonatomic) IBOutlet UITextField *textField1;
@property (strong, nonatomic) IBOutlet UITextField *textField2;
@property (strong, nonatomic) IBOutlet UITextField *textField3;
@end
NSArray *textFields = @[_textField1,
_textField2,
_textField3];
keyboardHandler = [KeyboardHandler handleWithView:self.view textFields:textFields];