2013-08-23 40 views
1

我試圖用從Last.fm API讀取的藝術家列表顯示UITableView。我將所有的藝術家存儲在一個數組中,然後顯示一張包含您的名字和圖片的表格。滾動時減少TableViewController中的圖像

最初的照片看起來不錯,但是當我滾動時,圖像非常小。

這是最初的外觀:

enter image description here

這是滾動後的外觀,這個問題:

enter image description here

這是我的代碼用於創建細胞:

- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath 
{ 
    static NSString *CellIdentifier = @"TopArtistCell"; 

    UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier forIndexPath:indexPath]; 

    JSCArtist *artist = self.artists[indexPath.row]; 

    cell.textLabel.text = [artist name]; 
    [cell.imageView setImageWithURL:[NSURL URLWithString:[[artist photo] thumbnail]] placeholderImage: [UIImage imageNamed:@"default_photo.jpeg"]]; 

    return cell; 
} 
+0

可能重複? http://stackoverflow.com/questions/8024811/strange-uitableviewcellstylesubtitle-cell-imageview-behaviors – iHunter

回答

0

UITableView的默認imageView有點奇怪。我只會創建一個自定義的UITableViewCell子類並進行自己的佈局。