[iOS]UITableViewController 无法实现键盘自己主动适配
苹果官方文档:
The UITableViewController
class
implements the foregoing behavior by overriding loadView
, viewWillAppear:
,
and other methods inherited from UIViewController
.
In your subclass of UITableViewController
,
you may also override these methods to acquire specialized behavior. If you do override these methods, be sure to invoke the superclass implementation of the method, usually as the first method call, to get the default behavior.
意思是写UITableViewController的时候,重写UITableViewController loadView, viewWillAppear 的时候,必须 要调用实现父类方法
-(void)viewWillAppear:(BOOL)animated { //不加会导致无法使用父类的一些特性 [super viewWillAppear:YES]; if(!_imgFlag&&!_emailSaveFlag&&!_phoneSaveFlag) { [self getperspnInfo]; } } - (void)viewDidLoad { [super viewDidLoad];}
假设你出现了UITableViewController 无法自己主动适配键盘 请检查
重写方法时是否调用了父类的一些方法特性
[super viewWillAppear:YES];
[super viewDidLoad];