Forum Xamarin.Forms
We are excited to announce that the Xamarin Forums are moving to the new Microsoft Q&A experience. Q&A is the home for technical questions and answers at across all products at Microsoft now including Xamarin!

We encourage you to head over to Microsoft Q&A for .NET for posting new questions and get involved today.

how to Fill Image fullscreen in stackLayout ?

ShahabuddinVansiwalaShahabuddinVansiwala USMember ✭✭
edited November 2015 in Xamarin.Forms

how to Fill Image fullscreen in stackLayout in Xamarin ?

I can't set Image in fit to stacklayout

.XAML File Code

<?xml version="1.0" encoding="utf-8" ?>
<ContentPage xmlns=""
             x:Class="Test.FirstLoadScreen" >

  <StackLayout Padding="0" BackgroundColor="Yellow">
    <Image Source="ic_splash.png" HorizontalOptions="FillAndExpand" VerticalOptions="FillAndExpand" > </Image>

Screenshot of Output Android and Window Phone....

I want to fit Image in Background.

Best Answer


  • Finally I solved problem using below code....

    <?xml version="1.0" encoding="utf-8" ?>
    <ContentPage xmlns=""
                 Title="{Binding Title}"
        <!-- Your stuff goes here -->

    I have set background Image as fit to screen using above code....


  • SujaBSujaB USUniversity ✭✭✭


    I have a view with two stack layout. In the first stack layout i need to provide a background image and two buttons on left and right side of stack layout and a label.But using stack layout i can only provide background color instead of image .Could anyone please help me to solve this?.

  • SethBooneSethBoone USMember

    @Matthew.4307 said:
    In case anybody wants a solution to the original code it was probably this Image Aspect="Fill"

    This is exactly what I needed! Thank you for following through on the original question.

Sign In or Register to comment.