美文网首页
iOS11适配

iOS11适配

作者: zhanglizzy | 来源:发表于2017-12-15 10:17 被阅读27次

    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。

    相关文章

      网友评论

          本文标题:iOS11适配

          本文链接:https://www.haomeiwen.com/subject/atsemxtx.html