iphone uitableview to another view
in my program I need a tableview and, when you click onto a row, the view scroll left and show 开发者_Go百科the details (like the mail for example...) how can I do this?? I explain... it's an automatic thing or I need to manage by hand the animation of the view?? thanks in advance
I use UINavigationControllers to achieve this effect of the detail animating left when you click on the row. So you need a UINavigation controller above the UIViewController or UITableView Controller that controls your table.
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
{
...my code
[self.navigationController pushViewController:myViewController animated:YES];
}
Your case is exactly what UINavigationController
class is for - it will handle your controllers hierarchy and will do animated transition for you as well. To learn how to use it you can have a look at Apple's NavBar sample.
精彩评论