Tom van Zummeren
Tom van Zummeren

Reputation: 9220

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?

Upvotes: 4

Views: 2487

Answers (1)

Timothy Moose
Timothy Moose

Reputation: 9915

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.

Upvotes: 7

Related Questions