0

我可以知道使用从 url 获取后调整图像大小的任何方法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方法AsyncImageView

4

1 回答 1

0

尝试使用这个

_imageView.contentMode = UIViewContentModeRedraw;

于 2012-12-17T09:37:31.147 回答