gpt4 book ai didi

ios - tableView.beginUpdates 不适用于 iOS10

转载 作者:可可西里 更新时间:2023-11-01 04:55:54 24 4
gpt4 key购买 nike

在我的应用程序中,我使用 tableview.begingUpdates() 为我的 tableviewcell 高度(图像的扩展和碰撞)的变化设置动画。它在 iOS 8.0-9.3 上运行最佳。在 iOS10.0 之后它停止工作,原因不明。现在有人面临这个问题吗?

#pragma mark - Table view delegate
- (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath{
return self.selectedIndexPath && self.selectedIndexPath.row == indexPath.row ? self.view.frame.size.height - self.navigationController.navigationBar.frame.size.height + 20 : UITableViewAutomaticDimension;
}

didSelect 方法内部

if(shouldExpand){
[UIView animateWithDuration:0.3 delay:0 options:UIViewAnimationOptionCurveEaseInOut animations:^{
[self.tableView beginUpdates];
[self.tableView endUpdates];
} completion:nil];
}
else{
[self.tableView beginUpdates];
[self.tableView endUpdates];
}

最佳答案

我发现在 iOS10.0 中,父 View 约束的变化对于 subview 约束来说几乎是一团糟。向 Apple 提交了错误并等待答案。已报告,这里是 link

关于ios - tableView.beginUpdates 不适用于 iOS10,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/39704228/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com