0

新しい行を挿入したばかりの UITableView があり、この行の NSIndexPath を取得してスクロールしました。この行のセルを短時間点滅させるにはどうすればよいですか?

int indexOfRow = //retrieve row index
NSIndexPath *indexPath =  [NSIndexPath indexPathForRow:indexOfRow inSection:0];
[self.tableView scrollToRowAtIndexPath:indexPath atScrollPosition:UITableViewScrollPositionTop animated:YES];
//cause cell to blink

次は何ですか?

4

2 に答える 2

0

どうぞ:

UITableViewCell *tableCell = [[self tableView] cellForRowAtIndexPath:indexPath];
[tableCell setHighlighted:YES animated:NO];
[tableCell setHighlighted:NO animated:YES];
于 2012-10-01T16:14:36.647 に答える
0

これを試して:

- (void) someMethod {
    //your other code
    //...

    UITableViewCell *tableCell = [[self tableView] cellForRowAtIndexPath:indexPath];
    [tableCell setHighlighted:YES animated:NO];
    [self performSelector:@selector(completeCellBlink:) withObject:tableCell afterDelay:0.2];

}

- (void) completeCellBlink: (UITableViewCell*) cell {
    [tableCell setHighlighted:NO animated:YES];
}

遅延は秒単位で、もちろんその値を変更して視覚的な印象を調整できます。

于 2012-11-12T13:17:56.307 に答える