我想有uiimagview與該代碼tableviewcell已圓角:如何圓一個UIImageView的courners在tableViewCell
#import <QuartzCore/QuartzCore.h>
(UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
HomepwnerItemCell *cell = (HomepwnerItemCell *)[tableView dequeueReusableCellWithIdentifier:@"UITableViewCell"];
Possession *possession = [self.possessions objectAtIndex:indexPath.row];
cell.valueLabel.text = [@"$" stringByAppendingString:[[NSNumber numberWithInt:possession.valueInDollars] stringValue]];
cell.nameLabel.text = possession.possessionName;
UIImage *image = [[ImageCache sharedImageCache] imageForKey:possession.imageKey];
UIImageView *roundedImage = [[UIImageView alloc] initWithImage:image];
roundedImage.layer.masksToBounds = YES;
roundedImage.layer.cornerRadius = 10.0;
cell.imageView = roundedImage;
// cell.imageView.image = [[ImageCache sharedImageCache] imageForKey:possession.imageKey];
return cell;
}
但圖像顯示爲空白的tableViewCells當我運行。
它工作正常,如果我只是做cell.imageView.image = [[ImageCache sharedImageCache] imageForKey:possession.imageKey];
(但沒有圓角)
我在做什麼錯?
細胞.imageView = [roundedImage圖像];嘗試這個。 – Sarah 2011-12-29 05:25:14
錯誤:自動引用計數問題:實例消息的接收器類型'UIImageView'沒有聲明具有選擇器'Image'的方法 – ladookie 2011-12-29 05:27:59
檢查UIImage *圖像是否分配了內存? – Sarah 2011-12-29 05:43:09