作者热门文章
- android - RelativeLayout 背景可绘制重叠内容
- android - 如何链接 cpufeatures lib 以获取 native android 库?
- java - OnItemClickListener 不起作用,但 OnLongItemClickListener 在自定义 ListView 中起作用
- java - Android 文件转字符串
在我的应用程序中,我使用 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/
我是一名优秀的程序员,十分优秀!