【发布时间】:2012-03-30 11:53:11
【问题描述】:
我正在尝试使用此代码在表格视图单元格中从 UIImageVI 中的 URL 调用的图像居中并使其居中:
NSData *imageData= [[NSData alloc] initWithContentsOfURL:[NSURL URLWithString:news.image_small]];
cell.imageView.image=[UIImage imageWithData:imageData];
cell.imageView.layer.cornerRadius = 5.0;
cell.imageView.layer.masksToBounds = YES;
cell.imageView.layer.borderColor = [UIColor lightGrayColor].CGColor;
cell.imageView.layer.borderWidth = 1.0;
cell.imageView.contentMode = UIViewContentModeScaleAspectFit;
但是图像总是大于 UIImageVI 的大小。我该如何解决?
非常感谢
朋友
【问题讨论】:
标签: objective-c ios5