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="http://xamarin.com/schemas/2014/forms" xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml" x:Class="Test.FirstLoadScreen" > <StackLayout Padding="0" BackgroundColor="Yellow"> <Image Source="ic_splash.png" HorizontalOptions="FillAndExpand" VerticalOptions="FillAndExpand" > </Image> </StackLayout> </ContentPage>
Screenshot of Output Android and Window Phone....
I want to fit Image in Background.
Try something like this :
<?xml version="1.0" encoding="utf-8" ?> <ContentPage xmlns="http://xamarin.com/schemas/2014/forms" xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml" x:Class="Test.FirstLoadScreen" BackgroundImage="ic_splash.png"> </ContentPage>
Answers
Try something like this :
Finally I solved problem using below code....
I have set background Image as fit to screen using above code....
BackgroundImage="BackgroundImage.png"
Hi
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?.
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.