0

どのアプリケーションでも、テーブル ビューのセル選択の強調表示が、他のビューに移行する前に非常にスムーズに消えることがわかりました。このトピックについて検索しましたが、その例は見つかりませんでした。

ありがとう

4

1 に答える 1

1

あなたが説明した効果をそのように達成することができます。


-(void)tableView:(UITableView *)tv didSelectRowAtIndexPath:(NSIndexPath *)indexPath{
    [tv deselectRowAtIndexPath:indexPath animated:YES];
    double delayInSeconds = .3;
    dispatch_time_t popTime = dispatch_time(DISPATCH_TIME_NOW, delayInSeconds * NSEC_PER_SEC);
    dispatch_after(popTime, dispatch_get_main_queue(), ^(void){
        Location *loc = [self.locations objectAtIndex:indexPath.row];
        LocationDetailsController *locationDetails = [[[LocationDetailsController alloc] initWithNibName:nil bundle:nil] autorelease];
        locationDetails.location = loc;
        [self.navigationController pushViewController:locationDetails animated:YES];
    });
}

于 2012-05-04T18:39:18.240 に答える