右上角的设置按钮

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;
View Code

相关文章:

  • 2021-12-13
  • 2021-07-22
  • 2021-10-19
  • 2021-06-05
  • 2021-09-13
  • 2022-01-04
  • 2021-11-16
猜你喜欢
  • 2022-12-23
  • 2021-12-18
  • 2021-10-23
  • 2021-12-17
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案