Hi, i used the ib to create a uiimageview
footer
in the tableview
, i want that the image will appear all the time while rolling and not just when rolling to the end of the table,
is there a way to d that?
views:
259answers:
2No, the footer is part of the table itself. In fact, it is part of a section of the table. The footer only has meaning the in the context of the data above it so having a footer always visible would not make sense in the interface grammar.
Yes, but your view hierarchy will need to change.
You will need to make the view controller a subclass of UIViewController
, and a delegate for UITableViewDelegate
and UITableViewDataSource
.
In this arrangement, you have a normal view controller, with a base view that remains static. You add a UITableView
to that view, and depending on the size & placement you can have that base view showing at either top or bottom (or both).
Connect up your table-view to an outlet in the controller, set it's data source and delegate to the files-owner, and use the same delegate methods that a normal UITableViewController
does.
One thing I've noticed is that a UITableViewController
will automagically deselect any selected cell (either as the table disappears or reappears, I forget which). You will just have to manage that in:
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
or in
- (void)viewWillAppear:(BOOL)animated
.