Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/iphone/40.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/ios/103.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Iphone AsyncImageView具有固定但动态的高度?_Iphone_Ios_Resize_Imageview_Scale - Fatal编程技术网

Iphone AsyncImageView具有固定但动态的高度?

Iphone AsyncImageView具有固定但动态的高度?,iphone,ios,resize,imageview,scale,Iphone,Ios,Resize,Imageview,Scale,我使用aSyncImageView显示从URL下载的图像-图像有各种不同的大小,但我需要以300点的固定宽度显示图像,但我需要imageView的高度是动态的-我如何做到这一点 我看过不同的大小调整屏幕,但它们都只适合固定帧大小内的图像-但我需要帧高度是动态的,因为图片高度可以警惕几百点。 问题是我需要在设置框架时设置固定的宽度和高度 AsyncImageView *newsArticleImage = [[AsyncImageView alloc] init]; [newsArticleIma

我使用aSyncImageView显示从URL下载的图像-图像有各种不同的大小,但我需要以300点的固定宽度显示图像,但我需要imageView的高度是动态的-我如何做到这一点

我看过不同的大小调整屏幕,但它们都只适合固定帧大小内的图像-但我需要帧高度是动态的,因为图片高度可以警惕几百点。 问题是我需要在设置框架时设置固定的宽度和高度

AsyncImageView *newsArticleImage = [[AsyncImageView alloc] init];
[newsArticleImage loadImageFromURL:[NSURL URLWithString:[newsResultSet stringForColumn:@"image"]]];
newsArticleImage.frame = CGRectMake(10, (newsArticleDateLabel.frame.origin.y + newsArticleDateLabel.frame.size.height + 5), 300, 50);
newsArticleImage.autoresizingMask = UIViewAutoresizingFlexibleHeight;

如果不改变ASyncImageView或使用观察者处理它,似乎是不可能的。

没有人对此有建议吗?这似乎是一件相当琐碎的事情。