iOS11适配

1、tableView分组情况下,需要设定estimatedRowHeight estimatedSectionHeaderHeight estimatedSectionFooterHeight三个高度初始值,他,默认高度不再为0,变成了UITableViewAutomaticDimension;如不设置将出现大概四五十像素的高度差。个人喜欢方法一简单高效~
iOS 11中如果不实现-tableView: viewForFooterInSection: 和 -tableView: viewForHeaderInSection:,那么-tableView: heightForHeaderInSection:和- tableView: heightForFooterInSection:不会被调用。

方法一:

tableView. estimatedRowHeight = 0;
tableView.estimatedSectionFooterHeight = 0;
tableView.estimatedSectionHeaderHeight = 0;

方法二:

- (UIView *)tableView:(UITableView *)tableView viewForHeaderInSection:(NSInteger)section {
    return [[UIView alloc] init];
}

- (UIView *)tableView:(UITableView *)tableView viewForFooterInSection:(NSInteger)section {
    return [[UIView alloc] init];
}

2、打包ipa包时Appicon要加一个1024*1024的尺寸图适配iPhone X,否则上线不能提交审核;

3、导航栏高度不再是64,建议用宏定义获取高度(跟屏幕宽高同理);

4、相册权限需要在info.plist文件中添加NSPhotoLibraryUsageDescription键值对,描述文字不能为空。
iOS11之前:访问相册和存储照片到相册(读写权限),需要用户授权,需要添加NSPhotoLibraryUsageDescription。
iOS11之后:默认开启访问相册权限(读权限),无需用户授权,无需添加NSPhotoLibraryUsageDescription,适配iOS11之前的还是需要加的。
添加图片到相册(写权限),需要用户授权,需要添加NSPhotoLibraryAddUsageDescription。

最后编辑于
©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

推荐阅读更多精彩内容