How To Load Online Image In .NET MAUI Avatarview

Updated on Aug 13, 2024
avatar-view customization maui maui--avatar-view visual-customization

This article explains how to load online images in the .NET MAUI AvatarView. To display an online image in the AvatarView, it is recommended to utilize the UriImageSource from the ImageSource and set the ContentType property to Custom. This allows for the use of custom images, including those sourced from the web.

<VerticalStackLayout
    Padding="30,0"
    Spacing="25">
    <core:SfAvatarView AvatarSize="ExtraLarge"
                       HeightRequest="200"
                       AvatarShape="Square"
                       ContentType="Custom"
                       Aspect="AspectFill">
        <core:SfAvatarView.ImageSource>
            <UriImageSource Uri="https://cdn.syncfusion.com/content/images/Images/Camtasia_Succinctly.png?v=22022017060923"/>
        </core:SfAvatarView.ImageSource>
    </core:SfAvatarView>
</VerticalStackLayout>

By following this approach, you can easily load and display online images in your .NET MAUI applications.

Output

AvatarView.png