我的理解是,当您使用UITableViewController和表视图时,当调用键盘时,可视区域应自动缩小.它在我的应用程序的其他部分正常工作,只是没有这个静态表视图.静态表不起作用吗?还有什么我失踪的吗?有没有办法解决这个问题?
谢谢
解决方法
它与静态单元无关.他们应该工作
如果您的控制器已经是UITableViewController,请检查是否使用了ViewWillAppear的方法.如果你这样做,你必须调用[super viewWillAppear:YES]才能使’自动行为’工作.
-(void)viewWillAppear:(BOOL)animated { [super viewWillAppear:YES]; // This line is needed for the 'auto slide up' // Do other stuff }
由于控制器的样板代码不附带viewWillAppear方法调用,并且如果您在控制器中定义了该问题,则会容易出现此问题,您可以覆盖它.
额外的信息
看这个链接.
Apple Table View Programming Guide
Note: UITableViewController has new capabilities in iOS 3.0. A
table-view controller supports inline editing of table-view rows; if,
for example,rows have embedded text fields in editing mode,it
scrolls the row being edited above the virtual keyboard that is
displayed…. blah….
重要的一点
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.