Prad Prad - 3 months ago 29
iOS Question

Make ImageView Circular

I have an ImageView which I am attempting to make Circular in Xamarin. This would be simple enough and I would have done it with Core Animation, but the images are being downloaded Asynchronously like this:

this.profileImage.InvokeOnMainThread (() => this.profileImage.SetImage (
url: new NSUrl (datum.user.profile_picture)
)
);


How would I make these images circular?

Answer

This is How I ended Up fixing my issue:

this.profileImage.InvokeOnMainThread (() => this.profileImage.SetImage (
            url: new NSUrl (datum.user.profile_picture)
        )
    );

// Make Image Profile Image Circular
CALayer profileImageCircle = profileImage.Layer;
profileImageCircle.CornerRadius = 30;
profileImageCircle.MasksToBounds = true;
Comments