草庐IT

SDWebImage5

全部标签

ios - SDWebImage 检查图像是否使用 Swift 缓存 : Ambiguous Reference

我试图查明是否已经使用SDWebImage缓存了图像,但是当我尝试使用此方法时,我收到错误“对成员'cachedIageExistsForURL的引用不明确”。letbool=SDWebImageManager.cachedImageExistsForURL(imgURL)我正在使用Swift,并且我有一个桥接header来使用该库。 最佳答案 cachedImageExistsForURL不是SDWebImageManager上的类方法,它是您需要在sharedInstance上使用的实例方法:SDWebImageManager.

ios - 如何获取缓存图像 SDWebImage 的数据

我正在使用SDWebImage库在我的UICollectionView中缓存网络图像:cell.packItemImage.sd_setImage(with:URL(string:smileImageUrl[indexPath.row]))但我想将缓存的图片保存在本地文件中,而不是再次下载它们FileManager.default.createFile(atPath:newPath,contents:Data(contentsOf:URL(string:snapchildvalue[Constants.smiles.smileImageUrl]as!String)!),attribut

ios - SDWebImage + UITableViewCell,滚动时图像错误?

我在使用SDWebImage将图像加载到自定义UITableViewCell内的UIImageView时遇到问题。这是我在UITableView委托(delegate)中的代码:staticNSString*userTableId=@"userTableId";UserDetailsTableViewCell*cell=(UserDetailsTableViewCell*)[tableViewdequeueReusableCellWithIdentifier:userTableId];NSDictionary*user=[userListobjectAtIndex:indexPath.

ios - SDWebImage + UITableViewCell,滚动时图像错误?

我在使用SDWebImage将图像加载到自定义UITableViewCell内的UIImageView时遇到问题。这是我在UITableView委托(delegate)中的代码:staticNSString*userTableId=@"userTableId";UserDetailsTableViewCell*cell=(UserDetailsTableViewCell*)[tableViewdequeueReusableCellWithIdentifier:userTableId];NSDictionary*user=[userListobjectAtIndex:indexPath.

iOS SDWebImage 淡入新图像

我一直在我的iPhone应用程序上使用SDWebImage来处理所有图像加载。我正在使用占位符图像,我想在新图像加载后交叉淡入淡出或淡入淡出。我正在使用成功block来设置图像,并且效果很好。无论我尝试什么,图像都不会淡入。我试过将动画代码发送回主线程,但这也无济于事。它只是立即加载...没有动画。这是我的代码。有什么想法吗?//loadplaceholderimageNSURL*url=..._imageView=[[UIImageViewalloc]init];[_imageViewsetImage:[UIImageimageNamed:@"loading.jpg"]];//req

iOS SDWebImage 淡入新图像

我一直在我的iPhone应用程序上使用SDWebImage来处理所有图像加载。我正在使用占位符图像,我想在新图像加载后交叉淡入淡出或淡入淡出。我正在使用成功block来设置图像,并且效果很好。无论我尝试什么,图像都不会淡入。我试过将动画代码发送回主线程,但这也无济于事。它只是立即加载...没有动画。这是我的代码。有什么想法吗?//loadplaceholderimageNSURL*url=..._imageView=[[UIImageViewalloc]init];[_imageViewsetImage:[UIImageimageNamed:@"loading.jpg"]];//req

ios - SDWebImage 在滚动之前不会加载远程图像

我正在使用SDWebImage库将远程图像加载到使用我创建的自定义单元格类的表格View中。我只是使用[cell.imageViewsetImageWithURL:urlplaceholderImage:[UIImageimageNamed:@"loading.jpg"]];在cellForRowAtIndexPath中:现在的问题是它只在可见单元格中加载图像,而不是在屏幕外的单元格中,我必须上下滚动才能加载它们。有什么方法可以加载所有图像而无需滚动表格View。提前致谢!! 最佳答案 如果要预取行,可以回复UIScrollView

ios - SDWebImage 在滚动之前不会加载远程图像

我正在使用SDWebImage库将远程图像加载到使用我创建的自定义单元格类的表格View中。我只是使用[cell.imageViewsetImageWithURL:urlplaceholderImage:[UIImageimageNamed:@"loading.jpg"]];在cellForRowAtIndexPath中:现在的问题是它只在可见单元格中加载图像,而不是在屏幕外的单元格中,我必须上下滚动才能加载它们。有什么方法可以加载所有图像而无需滚动表格View。提前致谢!! 最佳答案 如果要预取行,可以回复UIScrollView

ios - 使用 SDWebimage 在 UIButton 中设置背景图像

我想使用SDWebImage设置UIButton背景图像。代码:-[btn.imageViewsetImageWithURL:[NSURLURLWithString:@"imageurlhere"]placeholderImage:[UIImageimageNamed:@"placeholder"]];谢谢 最佳答案 在SDWebImage中有这样的方法:SDWebImage/SDWebImage/UIButton+WebCache.h在您的类(class)中导入此文件:#import使用以下任一方法:-(void)sd_setBa

ios - 使用 SDWebimage 在 UIButton 中设置背景图像

我想使用SDWebImage设置UIButton背景图像。代码:-[btn.imageViewsetImageWithURL:[NSURLURLWithString:@"imageurlhere"]placeholderImage:[UIImageimageNamed:@"placeholder"]];谢谢 最佳答案 在SDWebImage中有这样的方法:SDWebImage/SDWebImage/UIButton+WebCache.h在您的类(class)中导入此文件:#import使用以下任一方法:-(void)sd_setBa