问题描述
我有一个UITableViewController与大约20个静态单元格,其中一些单元格有UITextFields在其中,一些只是用于选择与复选标记。
I have a UITableViewController with around 20 static cells, some of these cells have UITextFields within them and some are just for selecting with a checkmark. The table is about 1.5 views worth so scrolling is required to get at the lower text fields.
当我点击表格底部的文本框时,键盘弹出因为它应该,但这然后出现在单元格/文本字段。
When I click within a textfield at the bottom of the table the keyboard pops up as it should but this then appears over the cell/textfield.
我的印象(从苹果文档和其他地方),UITableViewController类处理视图的滚动自动当键盘出现在任何方向,并向上移动tableview,以使单元格是可见的,这是没有发生,虽然。
I was under the impression (From Apple docs and elsewhere) that the UITableViewController class handles scrolling of the view automatically when a keyboard appears in any orientation and shifts the tableview up so that the cell is visible, this isn't happening though.
任何想法我错过了吗?
Any ideas what I've missed here?
感谢
Geoff
IOS 5.1,iPad Portrait。
ThanksGeoffIOS 5.1, iPad Portrait.
推荐答案
确保如果您重写 viewWillAppear
,您将调用
Make sure that if you are overriding viewWillAppear
that you call
[super viewWillAppear:animated];
如果没有,滚动视图将无法正常向上滚动。
If you don't, the Scroll View will not scroll up properly.
这篇关于UITableViewController当键盘出现时不滚动视图的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!