【问题标题】:How to display a base64 image within a UIImageView Using AFNetworking?如何使用 AFNetworking 在 UIImageView 中显示 base64 图像?
【发布时间】:2013-07-18 09:25:30
【问题描述】:

我正在使用 base64 图像,它使用下面的代码在 imageview 中显示

NSURL *url = [NSURL URLWithString:prodDetCompl.AttPath];
NSData *imageData = [NSData dataWithContentsOfURL:url];
UIImage *ret = [UIImage imageWithData:imageData];
cell.imageView.image = ret;

但我需要使用 AFNetworking 来加载图像不成功

[imageview setImageWithURL:[NSURL URLWithString:@""] placeholderImage:[UIImage imageNamed:@"sampleimages.jpeg"]]

怎么做

谢谢

【问题讨论】:

  • AFNetworking 许可证中是否有任何内容阻止您进行更改?

标签: ios ios6 uiimageview uiimage afnetworking


【解决方案1】:

我不确定我是否理解什么对你不起作用,但你不应该做这样的事情吗:

NSURL *url = [NSURL URLWithString:prodDetCompl.AttPath];
[imageview setImageWithURL:url placeholderImage:[UIImage imageNamed:@"sampleimages.jpeg"]]

当然,您应该确保捆绑资源中有一个“sample images.jpeg”图像可用作占位符图像。

【讨论】:

  • 您确定占位符图片已与您的应用捆绑在一起吗?
猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 2018-02-26
  • 2021-12-20
  • 2021-11-02
  • 1970-01-01
  • 1970-01-01
  • 2018-02-04
  • 2020-09-06
相关资源
最近更新 更多