Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

System.MemberAccessException: Cannot create an instance of Ricardo.SDWebImage.iOS.SDWebImageOperation because it is an abstract class #1

Open
MAX-POLKOVNIK opened this issue Sep 13, 2018 · 0 comments

Comments

@MAX-POLKOVNIK
Copy link

Hello!
Recently I replaced default Xamarin SDWebImage library bindings with this library bindings.

In Xamarin binding code below works perfrect:

SDWebImageManager.SharedManager().LoadImageWithURL(NSUrl.FromString(markerParams.CustomIcon), SDWebImageOptions.HighPriority, null,
                (image, data, error, cacheType, finished, imageUrl) => 
                    {
                        if (googleMarker.IconView != null && finished)
                        {
                            ((UIImageView)googleMarker.IconView).Image = _mapMarkerImageService.GetUserAvatarIcon(image);
                        }
                    });

But with this library it throws exception:

System.MemberAccessException: Cannot create an instance of Ricardo.SDWebImage.iOS.SDWebImageOperation because it is an abstract class.

I found workaround like this:

new UIImageView().Sd_setImageWithURL(NSUrl.FromString(markerParams.CustomIcon), (image, error, type, url) =>
                {
                    if (error == null)
                    {
                        ((UIImageView)googleMarker.IconView).Image = _mapMarkerImageService.GetUserAvatarIcon(image);
                    }
                });

So can I get it works without creating fake imageView??

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant