• UIImagePickerController导航字体颜色和背景


    创建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:18]} forState:UIControlStateNormal];
        
        [viewController.navigationItem.leftBarButtonItem setTitleTextAttributes:@{NSForegroundColorAttributeName:[UIColor whiteColor], NSFontAttributeName:[UIFont systemFontOfSize:18]} forState:UIControlStateNormal];
    }
  • 相关阅读:
    SpringCloud简介及使用
    容器云技术选择之kubernetes和swarm对比
    LXC简单介绍与使用
    go recover让崩溃的程序继续执行
    dbeaver可视化工具-连接clickhouse
    JavaScript异步与Promise基本用法(resolve与reject)
    通过mysql操作clickhouse
    clickhouse客户端使用
    clickhouse安装数据导入及查询测试
    spring boot druid数据源
  • 原文地址:https://www.cnblogs.com/Milo-CTO/p/7447108.html
Copyright © 2020-2023  润新知