我想知道我缺少什么,因为隐藏删除按钮时我的单元格没有动画。在删除按钮完成动画之前,标签会跳回原始位置。
当我点击圆形编辑视图以显示删除按钮时,标签动画起作用:
但是,当我再次点击它以隐藏删除按钮时,标签的移动没有动画:
注意:这些屏幕截图不是从以下代码创建的。但他们显示了问题。
// Customize the appearance of table view cells.
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
static NSString *CellIdentifier = @"Cell";
homeCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier];
if (cell == nil) {
cell = [[homeCell alloc] initWithStyle:UITableViewCellStyleSubtitle reuseIdentifier:CellIdentifier];
}
// Set up the cell
Consumed *drinkObj = [self.appDelegate.consumedDrinksArray objectAtIndex:indexPath.row];
cell.titleLabel.text = drinkObj.drinkName;
NSString *detailTextTime = [NSDate stringFromDate:drinkObj.dateConsumed withFormat:@"h:mma"];
NSString *detailTextrelative = [relativeDateTransformer transformedValue:drinkObj.dateConsumed];
NSString *detailText = [NSString stringWithFormat:@"%@ %@ ", detailTextTime,detailTextrelative];
cell.timeLabel.text = detailText;
cell.stdDLabel.text = @"999.0"; //[NSString stringWithFormat:@"%@", drinkObj.standardDrinks];
cell.stdDLabel.autoresizingMask = UIViewAutoresizingFlexibleLeftMargin | UIViewAutoresizingFlexibleRightMargin;
cell.titleLabel.autoresizingMask = UIViewAutoresizingFlexibleWidth|UIViewAutoresizingFlexibleLeftMargin | UIViewAutoresizingFlexibleRightMargin;
cell.timeLabel.autoresizingMask = UIViewAutoresizingFlexibleWidth|UIViewAutoresizingFlexibleLeftMargin | UIViewAutoresizingFlexibleRightMargin;
cell.selectionStyle = UITableViewCellSelectionStyleNone;
return cell;
}