So i have a UITableview
with 3 different tabs setup.
I want to scroll the table to a specific item.
If user added a new item, table to scroll all the way to the bottom because that's where the item will be added.
If user picks one of the items and edits it, it should come back to the same position on the table. Not scrolled to the top or bottom.
This is what I have:
This is a class variable.
NSIndexpath lastScrollY;
In my ViewWillDisappear
:
lastScrollY = this.tableView.IndexPathForSelectedRow() ;
In my ViewWillAppear
:
if(lastScrollY != null) {
this.tableView.ScrollToRow(lastScrollY, UITableViewScrollPosition.None, true);
}
this does not seem to work. And that is only for when user selects a saved item. What about when then add a new item/row to the table?
Please explain in detail as I am new to this.
Thank you for your time!