Frame

You can used a Frame to wrap other controls to create a border with color, shadow or rounded corners. This is required as .NET MAUI controls do not support a border out of the box.

mauiman Tip: Take a look at the new Border control.


        <StackLayout Margin="10">
            <Frame CornerRadius="5" 
                    BorderColor="Blue" 
                    HasShadow="true" 
                    Margin="10" >
                <Label Text="With a Frame" />
            </Frame>
            <Label Margin="10" 
                    Text="Without a Frame" />
        </StackLayout>                    
                

Frame - Round Image

A Frame is useful for creating a round image.


        <Frame CornerRadius="25" 
                BorderColor="Red" 
                HeightRequest="50"
                WidthRequest="50">
            <Image Source="redappleisolated.jpg"
                    Aspect="AspectFill"
                    Margin="-10"
                    HeightRequest="30"
                    WidthRequest="30" />
        </Frame>
            

The CornerRadius is set to half of the Width and Height to create a rounded Frame. The Image Magin is adjust to center the image in the Frame.

Download

.NET MAUI