美文网首页
iOS11适配(trailingSwipeActionsConf

iOS11适配(trailingSwipeActionsConf

作者: 麟升bazinga | 来源:发表于2017-11-02 10:19 被阅读0次

    iOS11适配遇到的坑

    一.UITableView

    1.scrollView展示出现下移

    解决办法

    [UIScrollView appearance].contentInsetAdjustmentBehavior=UIScrollViewContentInsetAdjustmentNever;

    webview得单独处理

    _webView.scrollView.contentInsetAdjustmentBehavior=UIScrollViewContentInsetAdjustmentNever;

    2.tableView动态算高度导致页面抖动

    [UITableView appearance].estimatedRowHeight=0;

    [UITableView appearance].estimatedSectionHeaderHeight=0;

    [UITableView appearance].estimatedSectionFooterHeight=0;

    3.tableView滑动模块无法滑动返回解决

    iOS11新方法trailingSwipeActionsConfigurationForRowAtIndexPath / leadingSwipeActionsConfigurationForRowAtIndexPath会监听左滑右滑事件,所以左滑无法滑动返回的解决办法就是处理leadingSwipeActionsConfigurationForRowAtIndexPath方法

    - (id)tableView:(UITableView*)tableView leadingSwipeActionsConfigurationForRowAtIndexPath:(NSIndexPath*)indexPath//id的目的是防止警告

    {

    if(@available(iOS11, *))

    {

    tableView.editing=false;

    }

    return nil;

    }

    (小tips,如果不需要横滑删除,设置滑动配置的performsFirstActionWithFullSwipe为false属性即可)

    二.相册无法自定义编辑

    iOS11的相册编辑页面已经无法获取到实际覆盖层(没细看dump的类,应该可以用runtime修改,地址:http://developer.limneos.net/?ios=11.0&framework=PhotosUI.framework),我的解决办法,自己实现编辑页面,直接做跳转。

    三导航栏颜色问题

    1.无法设置透明

    主要是prefersLargeTitles导致的,但是单独设prefersLargeTitles这个值,返回会导致字体变大的问题。我的思路是先设置上级页面title为空,viewDidAppear的时候赋值title值。这样会导致一个小问题,顶部title会渐出。整体代码待完善,就不贴了,考虑自己实现导航栏。在这里请教大家有什么好的想法。

    (待补充)

    相关文章

      网友评论

          本文标题:iOS11适配(trailingSwipeActionsConf

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