一:

        //    UIButton *editSome; 为全局变量,已开启ARC;

        editSome = [UIButton buttonWithType:UIButtonTypeCustom];
        editSome.frame = kCCR(0, 0, 45, 25);
        [editSome setTitle:@"编辑" forState:UIControlStateNormal];
        [editSome setTitleColor:[UIColor whiteColor] forState:UIControlStateNormal];
        editSome.titleLabel.font = [UIFont fontWithName:@"Verdana-Bold" size:13];
        [editSome setBackgroundImage:[UIImage imageNamed:@"navBarRightIMG.png"] forState:UIControlStateNormal];
        [editSome addTarget:self action:@selector(editButtonItemChange) forControlEvents:UIControlEventTouchUpInside];
        UIBarButtonItem *editSomes = [[UIBarButtonItem alloc]initWithCustomView:editSome];
        self.navigationItem.rightBarButtonItem = editSomes;

  二:

-(void)editButtonItemChange
{
    static BOOL isTure = YES;    
    if (isTure) {
        [editSome setTitle:@"完成" forState:UIControlStateNormal];
    }
    else {
        [editSome setTitle:@"编辑" forState:UIControlStateNormal];
    }
    [collectedListTableVC setEditing:isTure animated:YES];
    [super setEditing:isTure animated:YES];
    isTure = !isTure;

}

  

相关文章:

  • 2022-03-08
  • 2021-09-15
  • 2021-08-10
  • 2021-07-01
  • 2022-12-23
  • 2022-12-23
  • 2021-10-28
  • 2021-06-08
猜你喜欢
  • 2021-05-20
  • 2021-08-07
  • 2022-01-16
  • 2021-06-25
  • 2021-08-30
  • 2021-10-29
相关资源
相似解决方案