iOS 增加右側(cè)按鈕功能實(shí)例代碼
更新時(shí)間:2017年07月17日 10:39:30 作者:弦外雨
這篇文章主要介紹了iOS 增加右側(cè)按鈕功能實(shí)例代碼,需要的朋友可以參考下
一,工程圖。

二,代碼。
ViewController.m
- (void)viewDidLoad {
[super viewDidLoad];
// Do any additional setup after loading the view, typically from a nib.
//增加右側(cè)按鈕
[self addRightButton];
}
#pragma -mark -functions
//增加右側(cè)按鈕
-(void)addRightButton
{
UIBarButtonItem *selectButton = [[UIBarButtonItem alloc] initWithTitle:@"篩選" style:UIBarButtonItemStyleDone target:self action:@selector(doClickRightButton)];
self.navigationItem.rightBarButtonItem = selectButton;
}
#pragma -mark -doClickAction
-(void)doClickRightButton
{
FirstViewController *first=[[FirstViewController alloc]init];
[self.navigationController pushViewController:first animated:NO];
}
以上所述是小編給大家介紹的iOS 增加右側(cè)按鈕功能實(shí)例代碼,希望對(duì)大家有所幫助,如果大家有任何疑問(wèn)請(qǐng)給我留言,小編會(huì)及時(shí)回復(fù)大家的。在此也非常感謝大家對(duì)腳本之家網(wǎng)站的支持!
您可能感興趣的文章:
相關(guān)文章
iOS runtime forwardInvocation詳解及整理
這篇文章主要介紹了 iOS runtime forwardInvocation詳解及整理的相關(guān)資料,需要的朋友可以參考下2017-02-02
iOS UIScrollView滾動(dòng)視圖/無(wú)限循環(huán)滾動(dòng)/自動(dòng)滾動(dòng)的實(shí)例代碼
這篇文章主要介紹了iOS UIScrollView滾動(dòng)視圖/無(wú)限循環(huán)滾動(dòng)/自動(dòng)滾動(dòng),需要的朋友可以參考下2017-02-02
iOS 仿百度外賣-首頁(yè)重力感應(yīng)的實(shí)例
這篇文章主要介紹了iOS 仿百度外賣-首頁(yè)重力感應(yīng)的實(shí)例,具有一定的參考價(jià)值,感興趣的小伙伴們可以參考一下。2017-01-01

