iOS 增加右側(cè)按鈕功能實(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í)例代碼,希望對大家有所幫助,如果大家有任何疑問請給我留言,小編會及時回復(fù)大家的。在此也非常感謝大家對腳本之家網(wǎng)站的支持!
相關(guān)文章
iOS runtime forwardInvocation詳解及整理
這篇文章主要介紹了 iOS runtime forwardInvocation詳解及整理的相關(guān)資料,需要的朋友可以參考下2017-02-02iOS UIScrollView滾動視圖/無限循環(huán)滾動/自動滾動的實(shí)例代碼
這篇文章主要介紹了iOS UIScrollView滾動視圖/無限循環(huán)滾動/自動滾動,需要的朋友可以參考下2017-02-02iOS 仿百度外賣-首頁重力感應(yīng)的實(shí)例
這篇文章主要介紹了iOS 仿百度外賣-首頁重力感應(yīng)的實(shí)例,具有一定的參考價值,感興趣的小伙伴們可以參考一下。2017-01-01