Navigationbar 右侧按钮

UIBarButtonItem *updateButton = [[UIBarButtonItem alloc] initWithTitle:@"修改" style:UIBarButtonItemStylePlain target:self action:@selector(updateInfo)];

    self.navigationItem.rightBarButtonItem = updateButton;

navigationbar 左侧按钮

 self.navigationItem.leftBarButtonItem = [[[UIBarButtonItem alloc] initWithTitle:@"首页"style:UIBarButtonItemStyleBordered target:self action:@selector(popToRootView)] 

                                             autorelease];

    self.navigationItem.rightBarButtonItem = [[[UIBarButtonItem alloc] initWithTitle:@"测试"style:UIBarButtonItemStyleBordered target:self action:@selector(test)] 

                                              autorelease];

}

- (void)popToRootView

{

    [self.navigationController popToRootViewControllerAnimated:YES];

}

posted @ 2015-07-06 13:32  溜溜达达  阅读(414)  评论(0编辑  收藏  举报