这的确是一个问题,我学习iOS
而试图建立一个应用程序iOS:UIImageView随着UITableView.rowHeight的变化而改变,如何避免?
我需要显示的图像,标签上UITableViewCell
。下面的代码对我来说是这样的
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier forIndexPath:indexPath];
cell.imageView.image = [self getImageNameForRow:indexPath.row];
cell.textLabel.text = self.features[(NSUInteger) indexPath.row];
cell.imageView.contentMode = UIViewContentModeScaleAspectFit;
return cell;
}
问题是图像尺寸变大了,我期望。所以我试图增加行的高度
self.tableView.rowHeight = 80;
但是,然后图像也放大。
如何我把我的图像尺寸固定,同时增加(或改变)行的大小?
太棒了,正是我在找的东西,谢谢你与我分享! – daydreamer 2014-08-31 01:04:51