1

我正在尝试显示UITableView从 Last.fm API 读取的艺术家列表。我将所有艺术家存储在一个数组中,然后显示一个包含您的姓名和图片的表格。

最初照片看起来不错,但是当我滚动时,图像非常小。

这是最初的外观:

在此处输入图像描述

这是滚动后的样子,有问题:

在此处输入图像描述

这是我创建单元格的代码:

- (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;
}
4

1 回答 1

0

UITableView 的默认 imageView 有点奇怪。我只会创建一个自定义 UITableViewCell 子类并进行自己的布局。

于 2013-08-23T18:38:22.527 回答