AsyncImageView oncomplete调整大小

时间:2012-12-17 07:54:44

标签: objective-c ios

使用AsyncImageView从网址获取后,我是否知道调整图片大小的方法?这是我到目前为止的代码:

NSLog(@"image x:%f y:%f", _imageView.frame.origin.x, _imageView.frame.origin.y);
NSLog(@"image w:%f h:%f", _imageView.frame.size.width, _imageView.frame.size.height);
NSLog(@"image w:%f h:%f", _imageView.image.size.width, _imageView.image.size.height);


_imageView.image = [UIImage imageNamed:@"Placeholder.png"];


//cancel loading previous image for cell
[[AsyncImageLoader sharedLoader] cancelLoadingImagesForTarget:_imageView];

//load the image
_imageView.imageURL = [NSURL URLWithString:[NSString stringWithFormat:@"%@%@",[AppSetting getPkParkingPhotoPath],[_data objectForKey:@"photo"]]];

_imageView.contentMode = UIViewContentModeScaleAspectFill;

NSLog(@"image x:%f y:%f", _imageView.frame.origin.x, _imageView.frame.origin.y);
NSLog(@"image w:%f h:%f", _imageView.image.size.width, _imageView.image.size.height);

我希望获得图像的真实尺寸并调整大小。适合宽度和动态高度。 如何委托onComplete的{​​{1}}方法?

1 个答案:

答案 0 :(得分:0)

尝试使用此

_imageView.contentMode = UIViewContentModeRedraw;