views:

887

answers:

1

Hi

I'm struggling to create a table view controller that has anything more than just a table view in it.

I don't want to use a footer view, as I'd like a toolbar at the bottom of the page, and there are cases where there aren't enough rows in the table to put the footer at the bottom of the screen. The other issue with this is that the toolbar bounces ;)

I've tried to not use a UITableViewController and use a UIViewController with This works okay, but when the table returns when I click back on the navigation control the row remains highlighted.

So I have two questions: 1. How do I get the row to fade out like it does with the UITableViewController? and 2. Is it possible to add other UI elements that aren't UITableViews to a UITableViewController?

Thanks Carl

+1  A: 

About the first question,

I had the same problem. you can see my question at http://stackoverflow.com/questions/777321/how-to-perform-a-cell-deselection-when-a-user-returns-to-a-table-view

as Daniel said:

UITableViewController automatically handles this for you when you call super in viewDidAppear: etc. So the easiest way to achieve this is to subclass UITableViewController. If you can't (e.g. because the table is just a part of a more complex view), then you'll have to do it yourself in the viewDidAppear: method. (You should also flash the scrollers, too).

About the second question:

I don't think you can do it. The table view can contain a header view, a footer view, table cells views and section views. You can add other any ui control you like in these 'sub'-views but not directly to the UITableViewController.

Panagiotis Korros
Thanks. That's what I thought. I also managed to do the deselect quite easily. I've tried it before and couldn't get it right. So for anyone that needs:Put this in viewDidAppear:[tableView deselectRowAtIndexPath:[tableView indexPathForSelectedRow] animated:YES];