4

UITableViewCellStyleDefault中,contentMode在 imageView 上设置没有结果。如果我将构建 SDK 更改为 3.1 版,一切都会再次正常工作。

在 3.0 上编译时我没有收到任何警告或错误,但是这段代码:

cell.imageView.contentMode = UIViewContentModeScaleAspectFit;
cell.imageView.image = [UIImage imageNamed:[[NSString stringWithFormat:@"%@head.jpg",[gametype objectAtIndex:indexPath.row]]lowercaseString]];

似乎默认为 UIViewContentModeCenter,所以我所有的图片都超出了单元格边界并侵占了相邻的单元格。

让我重申一下,如果我将目标更改为 3.1,一切正常,并且所有图片都会相应缩放以适合默认 imageView

这是一个已知的错误?

4

1 回答 1

1

使用 UITableViewCellStyleDefault 时,我在 iOS 4 SDK 上获得了相同的效果。

有关其他信息,请参阅iOS SDK UIViewContentModeScaleAspectFit 与 UIViewContentModeScaleAspectFill

于 2010-07-05T23:27:20.443 回答