Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

iOS: How to let UITableView draw its cells out of its bounds?

I have a UITableView which has cells I want to be drawn outside of its own bounds. The reason I want this is because in IOS 7 the keyboard is translucent, so I want the contents of the tableview to be visible through the keyboard.

I succeeded accomplishing the same with a UIScrollView. I simply set clipsToBounds to NO and off I go!

I know why the same thing doesn't work with UITableView, because it uses a clever reusing of cells trick. This means that cells which scroll out of bounds at the top get moved to the bottom to be reused there (and vise versa).

So I think I want a way to tell UITableView to extend the array of visible cells or something. Does anyone have a clever trick to accomplish this?

like image 555
Tom van Zummeren Avatar asked Mar 24 '23 01:03

Tom van Zummeren


1 Answers

I think the best way to accomplish this is to simply make the table bigger and set the table's contentInset with enough bottom padding so that you can scroll the entire table into view.

I think this is precisely the sort of thing contentInset is intended for.

like image 121
Timothy Moose Avatar answered Apr 27 '23 08:04

Timothy Moose