标签:des style blog http color io os 使用 ar
右上角的设置按钮
1 //****************** 右上角保存按钮 ****************** 2 UIButton *rightBtn = [UIButton buttonWithType:UIButtonTypeCustom]; 3 [rightBtn setBackgroundImage:[UIImage imageNamed:@"xiesixin.png"] forState:UIControlStateNormal]; 4 [rightBtn setFrame:CGRectMake(0, 0, 50, 30)]; 5 [rightBtn setTitle:@"保存" forState:UIControlStateNormal]; 6 [rightBtn addTarget:self action:@selector(rightBtnClick) forControlEvents:UIControlEventTouchUpInside ]; 7 UIBarButtonItem *searchButton = [[UIBarButtonItem alloc]initWithCustomView:rightBtn]; 8 self.navigationItem.rightBarButtonItem = searchButton; 9 self.tabBarController.hidesBottomBarWhenPushed = YES;
ms用的不是自定义NavgationController,所以需要使用到 UIBarButtonItem 来设置。
标签:des style blog http color io os 使用 ar
原文地址:http://www.cnblogs.com/xm5mao/p/3985693.html