使用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}}方法?
答案 0 :(得分:0)
尝试使用此
_imageView.contentMode = UIViewContentModeRedraw;