图像我有一些图片,我需要从网上获得。只需使用来自网址的数据。
他们需要在Retina显示屏上正确显示。
当我从网上的图片,他们仍然看起来是像素化。我需要将图像的缩放比例设置为视网膜显示(2.0),但我必须缺少一些东西。 这是我到目前为止所做的。Retina显示屏从URL
UIImage *img = [UIImage imageWithData:[NSData dataWithContentsOfURL:@"http://www.msdomains.com/tmp/test.png"];
CGRect labelFrame = CGRectMake(0,0,64,64);
UIImageView *imageView = [[UIImageView alloc] initWithFrame:labelFrame];
imageView.contentScaleFactor = [UIScreen mainScreen].scale;
[imageView setImage:img];
[self addSubview:imageView];
[imageView release];
这是真的吗? – Ali 2012-11-20 15:22:49
对我不起作用 – 2012-11-23 03:51:48
这是个玩笑吗? – deadlock 2014-03-01 15:13:22