簡體   English   中英

UITableViewCell imageView問題

[英]UITableViewCell imageView problems

我有一個自定義排行榜,可以將Game Center個人資料圖片加載到32高的UITableCell中。

發生的情況是,當我將圖像設置為200x32左右時,然后迅速將其調整為正方形。 在正確顯示圖像之前,用戶會看到圖像變形的閃光燈。

這是怎么回事 我怎樣才能解決這個問題?

- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
    if ([GCCustomLeaderboard sharedInstance]->nearbyScores.count == 0){
        return nil;
    }

    UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:@"MyBasicCell"];
    GCLeaderboardScore *playerScore = [[GCCustomLeaderboard sharedInstance]->nearbyScores objectAtIndex:indexPath.row];
    cell.textLabel.text = [NSString stringWithFormat:@"%@: (%d)", playerScore->alias, (int)playerScore->score];
    cell.imageView.image = playerScore->photo;

    return cell;
}

為了解決這個問題,我不得不在將圖像放入表格之前調整圖像的大小。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM