前言
在创建项目的时候需要做很多的配置项,因此小记一下,整理在一起方便查阅.
关闭https网络访问限制
-
info.plist文件中添加App Transport Security Settings - 在该选项下添加
Allow Arbitrary Loads选项,值为YES,忽略强制https访问的限制.
ios 10各种权限的申请
info.plist添加对应文字描述
- 相册:
NSPhotoLibraryUsageDescription - 相机:
NSCameraUsageDescription - 麦克风:
NSMicrophoneUsageDescription - 定位权限:
NSLocationUsageDescriptio NSLocationWhenInUseUsageDescription NSLocationAlwaysUsageDescription - 日历:
NSCalendarsUsageDescription - 提醒事项:
NSRemindersUsageDescription - 运动与健身:
NSMotionUsageDescription - 健康更新:
NSHealthUpdateUsageDescription - 健康分享:
NSHealthShareUsageDescription - 蓝牙:
NSBluetoothPeripheralUsageDescription - 媒体资料库
NSAppleMusicUsageDescription - 通讯录
NSContactsUsageDescription
访问图库或者使用UIImagePickerController的时候显示为英文
info.plist添加Localizations,添加item值为
Chinese (simplified)
关闭xcode 8系统日志的输出
打开菜单 Product -> Scheme -> Edit Scheme -> Environment Varibales 添加字段OS_ACTIVITY_MODE 并将属性值设置为 disable

图片.png
设置状态栏颜色
info.plist中添加View controller-based status bar appearance,值为NO
程序加载完成后设置
[[UIApplication sharedApplication] setStatusBarStyle:UIStatusBarStyleLightContent animated:YES];
导航器相关设置
//设置图片背景
[self.nav.navigationBar setBackgroundImage:[UIImage imageNamed:@"nav_bg.png"] forBarMetrics:UIBarMetricsDefault];
//设置title文字颜色
[self.nav.navigationBar setTitleTextAttributes:[NSDictionary dictionaryWithObjectsAndKeys:[UIColor whiteColor],NSForegroundColorAttributeName,nil]];