削除ボタンを非表示にするとセルがアニメーション化されないため、何が欠けているのか知りたいです。削除ボタンのアニメーションが終了する前に、ラベルが元の位置に戻ります。
ラウンド編集ビューをタップして削除ボタンを表示すると、ラベルアニメーションが機能します。
ただし、もう一度タップして削除ボタンを非表示にすると、ラベルの動きがアニメーション化されません。
注:これらのスクリーンショットは、次のコードから作成されたものではありません。しかし、彼らは問題を示しています。
// 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;
}