iOS11 bug 类似QQ好友折叠cell的bug

2017-11-22  本文已影响132人  船长_
demo.jpg QQ20171122-101451.png

问题描述:如图,当点击tableView的header,header会出现错乱,iOS10和iOS9都没问题,因此推测iOS11的bug

用以下代码可能出现上面情况

[tableView reloadSections:[NSIndexSet indexSetWithIndex:sender.tag] withRowAnimation:UITableViewRowAnimationAutomatic];

或者

    NSMutableArray *arrM = [NSMutableArray array];
    for (int i = 0; i<[dataSource[sender.tag] groupFriends].count; i++) {
        NSIndexPath *indexP = [NSIndexPath indexPathForRow:i inSection:sender.tag];
        [arrM addObject:indexP];
    }
    [tableView beginUpdates];
    if (groupModel.isOpened == YES) {
        [tableView insertRowsAtIndexPaths:arrM withRowAnimation:UITableViewRowAnimationAutomatic];
    }else{
        [tableView deleteRowsAtIndexPaths:arrM withRowAnimation:UITableViewRowAnimationAutomatic];
    }

    [tableView endUpdates];

用以上两种带有动画效果的方法展开和折叠在iOS11上都会出现问题
暂时解决方法,不过这样就没有动画效果了

[tableView reloadData];
上一篇 下一篇

猜你喜欢

热点阅读