美文网首页
导航栏右上角按钮

导航栏右上角按钮

作者: ljzza | 来源:发表于2019-05-06 10:15 被阅读0次

UIButton *completeButton = [UIButton buttonWithType:UIButtonTypeCustom];
completeButton.frame = CGRectMake(0, 0, 35, 35);
[completeButton setTitleColor:colorWithMainColor forState:UIControlStateNormal];
[completeButton setTitle:@"完成" forState:UIControlStateNormal];
completeButton.titleLabel.font = [UIFont systemFontOfSize:15.0];
[completeButton addTarget:self action:@selector(completeButtonClick:) forControlEvents:UIControlEventTouchUpInside];
UIBarButtonItem *rightItem = [[UIBarButtonItem alloc]initWithCustomView:completeButton];
self.navigationItem.rightBarButtonItem = rightItem;

相关文章

网友评论

      本文标题:导航栏右上角按钮

      本文链接:https://www.haomeiwen.com/subject/tzrvgqtx.html