2016-09-26 72 views
5

在我的應用程序中,我使用tableview.begingUpdates()來動畫我的tableviewcell高度(圖像的擴展和碰撞)的變化。它正在iOS 8.0-9.3上工作。 iOS10.0之後,它停止工作,原因不明。現在有人面臨這個問題嗎?tableView.beginUpdates不工作iOS10

#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]; 
} 
+0

用相關代碼更新您的問題。 – rmaddy

+0

非常基本沒有太多事情要做。 –

+0

這不是一個答案,而是更多的建議:你是否嘗試過在'''beginUpdates'''和'''endUpdates''之間調用'''reloadRowsAtIndexPaths:withAnimation:'''? –

回答

0

我發現,在iOS10.0一個上海華的約束條件的改變幾乎搞砸了子視圖的約束。向蘋果提交了一個錯誤並等待答案。已報告,這裏是link