Ash*_*eeq 5 objective-c uitableview ios
在我的应用程序中,我正在使用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;
}
Run Code Online (Sandbox Code Playgroud)
在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];
}
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
1110 次 |
| 最近记录: |