ios导航条添加按钮

UIBarButtonItem *btnSave = [[UIBarButtonItem alloc]
                                    initWithTitle:@"Save"                                            
                                    style:UIBarButtonItemStyleBordered
                                    target:self
                                 action:@selector(save_Clicked:)];
     self.navigationItem.rightBarButtonItem = btnSave;
     [btnSave release];

     UIBarButtonItem *btnCancel = [[UIBarButtonItem alloc]
                                    initWithTitle:@"Cancel"                                            
                                    style:UIBarButtonItemStyleBordered
                                    target:self
                                    action:@selector(save_Clicked)];
     self.navigationItem.leftBarButtonItem = btnCancel;
     [btnCancel release];

posted on 2012-06-08 17:31  麦克煎蛋  阅读(473)  评论(0编辑  收藏  举报