开发者

Moving the table view and keep the toolbar visible?

In my view I have a toolbar with a button at the top and a table view underneath, like in the following picture: alt text http://img34.imageshack.us/img34/5845/view2.png

An you can see there are text fields in the cells of the table view. The problem appears when I want to edit the tet fields which are in the bottom of the table view. As you can imagine the keyboard overlaps the text fields. Let say I want to edit the fields in the C section, the result is following: alt text http://img200.imageshack.us/img200/4685/keyboars.png

I tried different approaches f开发者_运维问答or moving the table view, but I always end up with the toolbar being hidden. In one cae the toolbar was moving up with together with the table view, in the second case the table view overlaps the toolbar: alt text http://img293.imageshack.us/img293/3310/iphonesimulator.png

All the ideas how to move the table view to make the cell being edited visible together with having the toolbar visible? How to move/resize the table view?

Thanks!


You could use the tableview contentInsets property:

//216 is keyboard height
theTable.scrollIndicatorInsets = UIEdgeInsetsMake(0, 0, 216, 0);
theTable.contentInset = UIEdgeInsetsMake(0, 0, 216, 0);


Have you tried scrolling the concerned row to the top of the tableview by using scrollToRowAtIndexpath?

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜