【发布时间】:2015-09-16 04:13:05
【问题描述】:
我正在使用此代码在我的 ios 应用上显示图像:
NSData *receivedData = [NSData dataWithContentsOfURL:[NSURL URLWithString:url]];
self.image=nil;
UIImage *img = [[UIImage alloc] initWithData:receivedData ];
self.image = img;
此代码适用于许多图像,但无法显示此图像: https://docs.google.com/uc?authuser=0&id=0Bw8vnOWKrLfgUmc3aHBkczkwbjQ&export=download
我的安卓应用也能正确显示!
有什么问题?
编辑: 我会提到我无法在我的 mac 预览中打开图像,它显示此消息:它可能已损坏或使用预览无法识别的文件格式。但我可以用 chrome 打开它。
【问题讨论】:
-
请添加安卓代码。这将帮助我理解为什么它在那里工作。
-
@Misha 我正在使用这个库github.com/thest1/LazyList
标签: ios objective-c image ios8 png