美文网首页
Xcode9的坑

Xcode9的坑

作者: YannChee | 来源:发表于2017-12-04 12:50 被阅读2次

在此记录一下,方便日后复制剪贴,节省时间😂

1.某些使用tableView或ScrollView界面下沉64dpt,原因是 automaticallyAdjustsScrollViewInsets 在iOS11被废弃

解决:

    if (@available(iOS 11.0, *)) {
        self.tableView.contentInsetAdjustmentBehavior = UIScrollViewContentInsetAdjustmentNever;
    } else {
        self.automaticallyAdjustsScrollViewInsets = NO;
    }

automaticallyAdjustsScrollViewInsets设置为NO,tableView的frame适配

  CGFloat navHeight = CGRectGetMaxY(self.navigationController.navigationBar.frame);
        CGRect tabFrame = CGRectMake(0, navHeight, SCREEN_WIDTH, SCREEN_HEIGHT-navHeight);

2.cell的顶部或者底部多出一片空白区域

- (CGFloat)tableView:(UITableView *)tableView heightForHeaderInSection:(NSInteger)section {
    return 0.001;
}
- (CGFloat)tableView:(UITableView *)tableView heightForFooterInSection:(NSInteger)section {
    return 0.001;
}

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

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

相关文章

  • xcode9的坑

    Module compiled with Swift 3.1 cannot be imported in Swif...

  • Xcode9的坑

    在此记录一下,方便日后复制剪贴,节省时间? 1.某些使用tableView或ScrollView界面下沉64dpt...

  • Xcode9 Cocoapos 报错 Generating Po

    自从升级到xcode9 就各种坑,下面是我在遇到Cocoapos 报错 Generating Pods proje...

  • XCode9的一些变化之处

    一直也没时间看xcode9的一些坑,今天看了一下,写一下个人对xcode9的一些改变的总结,希望对你有用。 1、代...

  • XCode 9后fastlane手动配置证书

    参考:当Fastlane遇到Xcode9打包出来不一定是ipa而是坑 Setting up your Xcode ...

  • xcode9的那些坑

    非常感谢大家利用自己宝贵的时间来阅读我的文章 , 升级xcode9也有一段时间了,记录了一下自己在xcode9使用...

  • 更新到Xcode9遇到的坑

    看到xcode9出来了后,想体验下xcode9的新特性,就把xcode更新到xcode9,而且因为xcode9必须...

  • Xcode9 -- 添加图片的坑

    这几天一直在修改一个项目,往里面添加图片,但不管怎么添加我的图片就是不能显示,一个好好的周末,全让这玩意毁了。后来...

  • Xcode9 - iOS 11- APP Icon设置无效 Ap

    今天更新了Xcode9 听说有坑 跑了下项目 APP icon 变成了下图 莫名的懵逼 ,检查了下配置没问题 只好...

  • Xocde9运行模拟器报Error returned in re

    版本:Xcode9 beta 6设备:Xcode9 beta 6模拟器

网友评论

      本文标题:Xcode9的坑

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