How do I add image overlays or text to an image in .NET MAUI?

Platform: .NET MAUI| Category: Controls

You can use the Image control as a background and overlay it with other controls like Label or BoxView to add text or other elements.

<Grid HeightRequest="200" WidthRequest="200">
    <Image Source="art.png" Aspect="AspectFill" />
    <StackLayout HorizontalOptions="Center"  BackgroundColor="#80000000" VerticalOptions="Center">
        <Label Text="Overlay Text" TextColor="White" FontAttributes="Bold" FontSize="24" />
    </StackLayout>
</Grid>

Share with

Related FAQs

Couldn't find the FAQs you're looking for?

Please submit your question and answer.