创建UIImagePickerController

 // 创建图片选择器
UIImagePickerController *picker = [[UIImagePickerController alloc] init];
picker.sourceType =UIImagePickerControllerSourceTypePhotoLibrary;
picker.allowsEditing = YES;
picker.delegate = self;

//设置导航栏背景颜色

picker.navigationBar.barTintColor = HexRGB(0x4294FE);

//设置右侧取消按钮的字体颜色

picker.navigationBar.tintColor = [UIColor whiteColor]; // 以富文本方式更改[picker.navigationBar setTitleTextAttributes:@{NSForegroundColorAttributeName:[UIColor whiteColor], NSFontAttributeName:[UIFont boldSystemFontOfSize:18]}];

           [self presentViewController:picker animated:YES completion:nil];

右侧取消按钮的字体方式无效可使用代理方法

- (void)navigationController:(UINavigationController *)navigationController willShowViewController:(UIViewController *)viewController animated:(BOOL)animated
{
[viewController.navigationItem.rightBarButtonItem setTitleTextAttributes:@{NSForegroundColorAttributeName:[UIColor whiteColor], NSFontAttributeName:[UIFont systemFontOfSize:]} forState:UIControlStateNormal]; [viewController.navigationItem.leftBarButtonItem setTitleTextAttributes:@{NSForegroundColorAttributeName:[UIColor whiteColor], NSFontAttributeName:[UIFont systemFontOfSize:]} forState:UIControlStateNormal];
}

最新文章

  1. ReactMix框架,让你实现一套js代码,基于ReactNative在H5,App都能完美跑起来,Write Once,Run Anywhere
  2. Crystal Reports "Access to report file denied. Another program may be using it."
  3. JavaWeb网页聊天室(WebSocket即时通讯)
  4. 用浏览器打开本地html 直接到首页 的解决方法
  5. 任E行M1端口比特率特征码
  6. 【转】The content of element type "configuration" must match "(properties?,settings?,typeAliases?,typeHandlers?,objectFactory?...
  7. 【转载】详解java类的生命周期
  8. 转场动画2-Pop动画
  9. c#--foreach遍历的用法与split的用法
  10. C#使用FFmpeg 将视频格式转换成Gif图片示例
  11. Ubuntu 发行版的 Linux 操作系统
  12. S2_SQL_第四章
  13. 通过四个例子理解JavaScript拓展运算符
  14. 8Manage:数据安全,企业新时代的护航利器
  15. Git与SVN的区别(面试常问)
  16. jquery开发插件提供的几种方法
  17. 保持APP后台NSTimer运行
  18. java 循环读取文件夹里面的文件
  19. 《学习OpenCV(中文版)》
  20. Java serialVersionUID作用和生成

热门文章

  1. nc-使用方法
  2. sar命令使用【转】
  3. Machine Learning系列--隐马尔可夫模型的三大问题及求解方法
  4. 更换git用户名或密码
  5. ireport报表制作, 当一个字段显示的数据太多时(数据过长),则需要自动换行
  6. javascript sleep方法
  7. DB2:FETCH FIRST 1 ROWS ONLY
  8. Python解释器【转载】
  9. [MySQL] specified key was too long max key length is 767bytes
  10. gym101431B