建立UIImagePickerController 字体
// 建立图片选择器 UIImagePickerController *picker = [[UIImagePickerController alloc] init]; picker.sourceType =UIImagePickerControllerSourceTypePhotoLibrary; picker.allowsEditing = YES; picker.delegate = self;
//设置导航栏背景颜色spa
picker.navigationBar.barTintColor = HexRGB(0x4294FE);代理
//设置右侧取消按钮的字体颜色code
picker.navigationBar.tintColor = [UIColor whiteColor]; // 以富文本方式更改[picker.navigationBar setTitleTextAttributes:@{NSForegroundColorAttributeName:[UIColor whiteColor], NSFontAttributeName:[UIFont boldSystemFontOfSize:18]}];orm
[self presentViewController:picker animated:YES completion:nil];
右侧取消按钮的字体方式无效可以使用代理方法blog
- (void)navigationController:(UINavigationController *)navigationController willShowViewController:(UIViewController *)viewController animated:(BOOL)animated { [viewController.navigationItem.rightBarButtonItem setTitleTextAttributes:@{NSForegroundColorAttributeName:[UIColor whiteColor], NSFontAttributeName:[UIFont systemFontOfSize:18]} forState:UIControlStateNormal]; [viewController.navigationItem.leftBarButtonItem setTitleTextAttributes:@{NSForegroundColorAttributeName:[UIColor whiteColor], NSFontAttributeName:[UIFont systemFontOfSize:18]} forState:UIControlStateNormal]; }