ios开发实现右侧按钮功能的内容-kb88凯时官网登录

时间:2023-04-15
阅读:
免费资源网 - https://freexyz.cn/

一,工程图。

二,代码。

viewcontroller.m

- (void)viewdidload {
  [super viewdidload];
  // do any additional setup after loading the view, typically from a nib.
  
  //增加右侧按钮
  [self addrightbutton];
}
#pragma -mark -functions
//增加右侧按钮
-(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];
}
免费资源网 - https://freexyz.cn/
返回顶部
顶部
网站地图