我已经为我的应用程序实现了一个应用程序扩展,但是在尝试将图像从 URL 加载到 imageView 时遇到了问题。我尝试使用 PAImageView 和 UIImageView 但都失败了。
我用于 PAImageView 的代码如下:
[self.imageView setImageURL:[NSURL URLWithString:@"https://blabblaLogo.jpg"]];
self.userImageView.clipsToBounds = YES;
并尝试将 SDWebImage 用于 UIImageView 与以下内容:
[self.imageView setImageWithURL:[NSURL URLWithString:url] placeholderImage:[UIImage imageNamed:@"default.png"] completed:^(UIImage *image, NSError *error, SDImageCacheType cacheType) {
}];
并且图像在这两种情况下都不会出现。请注意,资产中的默认图像可以正确显示,没有任何问题。
是否可以从应用扩展中的 URL 加载图像?我们怎样才能做到这一点?
谢谢你。