UIView *customView = [[UIView alloc] initWithFrame:CGRectMake(0.0f, 0.0f, 75.0f, 30.0f)];
        
        UIButton *editorCityBtn = [UIButton buttonWithType:UIButtonTypeCustom];
        [editorCityBtn setFrame:CGRectMake(0.0f, 0.0f, 30.0f, 30.0f)];
        [editorCityBtn setBackgroundImage:MF_PngWithSkin(@"Defaults", @"other60.png") forState:UIControlStateNormal];
        [editorCityBtn addTarget:self action:@selector(editorCityBtnClick:) forControlEvents:UIControlEventTouchUpInside];
        [customView addSubview:editorCityBtn];
        
        UIButton *addCityBtn = [UIButton buttonWithType:UIButtonTypeCustom];
        [addCityBtn setFrame:CGRectMake(35.0f, 0.0f, 30.0f, 30.0f)];
        [addCityBtn setBackgroundImage:MF_PngWithSkin(@"Defaults", @"ico_promotion43x42.png") forState:UIControlStateNormal];
        [addCityBtn addTarget:self action:@selector(addCityBtnClick:) forControlEvents:UIControlEventTouchUpInside];
        [customView addSubview:addCityBtn];
        
        UIBarButtonItem *rightBtn = [[UIBarButtonItem alloc] initWithCustomView:customView];
        [self.navigationItem setRightBarButtonItem:rightBtn];

 

相关文章:

  • 2021-09-08
  • 2022-12-23
  • 2021-08-02
  • 2022-12-23
  • 2022-12-23
  • 2022-02-14
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2021-08-20
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案