开发者

app with tab bar and navigation bars

app with tab bar and navigation bars

Hi all, this is a typical layout of one of apps. Now what I want on clicking of row of one of the view controllers(table view), I want to change the index of o开发者_开发技巧f the tab. Lets say I am in 3rd view, I want to move to the 1st view.

I tried with navigation controller's didShowViewController delegate method. Seems its not working. Could you please suggest any other way to do this?

Thanks.


Just use the below code in didSelectRowAtIndexPath method of UITableView, then you just need to set the SelectedIndex for Tabbar.

- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath {

    // Navigation logic may go here. Create and push another view controller.
    [self.tabBarController setSelectedIndex:indexPath.row];

}
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜