- 弹窗颜色(确定、取消,由蓝色改成黑色):
UIAlertController* alert = [UIAlertController alertControllerWithTitle:@"提示" message:@"重要!确定要情况所有提示任务吗?" preferredStyle:UIAlertControllerStyleAlert];
// __weak __typeof(self) weakSelf = self;
UIAlertAction* btn1 = [UIAlertAction actionWithTitle:@"确定" style:UIAlertActionStyleDefault handler:^(UIAlertAction * _Nonnull action) {
// TODO: 清空所有提醒任务!!
}];
UIAlertAction* btn2 = [UIAlertAction actionWithTitle:@"取消" style:UIAlertActionStyleCancel handler:nil];
[btn1 setValue:[UIColor blackColor] forKey:@"_titleTextColor"];
[btn2 setValue:[UIColor blackColor] forKey:@"_titleTextColor"];
[alert addAction : btn1];
[alert addAction : btn2];
[self presentViewController:alert animated:YES completion:nil];
- 导航栏文字颜色、返回按钮文字
self.navigationController.navigationBar.tintColor=[UIColor blackColor];
- iOS 修改导航栏上返回按钮上的文字,例如把 back 修改为 返回
UIBarButtonItem *backBtn = [[UIBarButtonItem alloc] init];
backBtn.title = @"返回";
self.navigationItem.backBarButtonItem = backBtn; // 注意这里的self是父ViewController,不是即将显示的子ViewController
4.iOS修改导航栏字体大小、颜色
[self.navigationController.navigationBar setTitleTextAttributes:@{NSFontAttributeName:[UIFont systemFontOfSize:20 weight:9],NSForegroundColorAttributeName:[UIColor redColor]}];
网友评论