Hello Team,
i have fetch data from server side and display it in listview. but before loading the image i want to show the placeholder or loader image can it be possible to show the placeholder in this library.
please help me to solve this issue.
Regards,
Arjun Dalal
I could not find anything in the code regarding a placeholder. My fix was to use absolute position to show another image on top of the fast image, and hide that view when the desired image finished loading. You can accomplish this by using the onLoad method.
In my case i was not showing a placeholder, but a progress bar, so I used the onProgress method.
For my case I'm using 1 placeholder for any image I load so I updated:
FastImageViewConverter.java
Drawable mDefaultSource = ResourcesCompat.getDrawable(res, R.drawable.nophoto1, null);
RequestOptions options = new RequestOptions()
.diskCacheStrategy(diskCacheStrategy)
.onlyRetrieveFromCache(onlyFromCache)
.skipMemoryCache(skipMemoryCache)
.priority(priority)
.placeholder(mDefaultSource);
and FFFastImageView.m
- (void)downloadImage:(FFFastImageSource *) source options:(SDWebImageOptions) options {
__weak typeof(self) weakSelf = self; // Always use a weak reference to self in blocks
[self sd_setImageWithURL:_source.url
placeholderImage:[UIImage imageNamed:@"noPhoto1.png"]
It would be a nice to have feature. Similar to defaultSource in normal Image component.
Any update on defaultSource props for library?
Most helpful comment
It would be a nice to have feature. Similar to defaultSource in normal Image component.