当我使用 setImageWithURL 加载在线图像时,我得到了 0.000000,但是当我加载本地图像时,我得到了正确的宽度。
NSURL * url1=[NSURL URLWithString:@"http://img.hb.aicdn.com/7f46b5eb65320f18f797a4a26ebe9ba328b547832f7b3-KYR0Xn_fw192"];
UIImageView * img2=[[UIImageView alloc] initWithFrame:CGRectMake(0, 0, 192,400)];
[img2 setImageWithURL:url1];
//[img2 setImage:[UIImage imageNamed:@"0.gif"]];
//load local image
[self.view addSubview:img2];
CGFloat height1=img2.image.size.width;
NSLog(@"%f",height1);