Ios 使用SDWebImage在服务器上更改映像时如何更新映像
我有图像的静态URL,但当我编辑该图像并返回主屏幕时,图像并没有改变,它仍然从缓存中获取旧图像 有什么方法可以更新缓存中的图像吗?在上,伙计们提供了一段代码来完成您需要的操作:Ios 使用SDWebImage在服务器上更改映像时如何更新映像,ios,sdwebimage,Ios,Sdwebimage,我有图像的静态URL,但当我编辑该图像并返回主屏幕时,图像并没有改变,它仍然从缓存中获取旧图像 有什么方法可以更新缓存中的图像吗?在上,伙计们提供了一段代码来完成您需要的操作: [imageView sd_setImageWithURL:[NSURL URLWithString:@"https://graph.facebook.com/olivier.poitrey/picture"] placeholderImage:[UIImage imageNamed:@"ava
[imageView sd_setImageWithURL:[NSURL URLWithString:@"https://graph.facebook.com/olivier.poitrey/picture"]
placeholderImage:[UIImage imageNamed:@"avatar-placeholder.png"]
options:SDWebImageRefreshCached];
是的,我做了相同的操作,但仍然没有获得刷新图像。您手动更改了应用程序中的图片?是的,我正在更改应用程序中的图像并将其上载到服务器上。您如何从url获取图像?请向我展示[self.imgProfilePic sd_setImageWithURL:[nsurlwithstring:[nsstringwithformat:@“%@”,ServerPath,userObj.profilePicture]]占位符图像:[UIImage ImageName:@“profile_placeholder”]选项:SDWebImageRefreshCached];当您当时编辑图片时,请尝试清除缓存[[SDImageCache sharedImageCache]imageCache clearMemory];[[SDImageCache sharedImageCache]imageCache clearDisk];