Forum Xamarin.Forms

Display a square image in an AbsoluteLayout

cmillauriauxcmillauriaux FRMember ✭✭
edited July 2016 in Xamarin.Forms

Hi everyone,

I want to make a ContentView with three elements : an image (100px * 100px), an another image (10px * 10px) positionned at the center of the first image and a label. I made a Stacklayout with an AbsoluteLayout for images and a Label.

My question is : how to parameter the AbsoluteLayout to display the image in a square ? The AbsoluteLayout have to take full width available, and images are square, so it have to take only the same size in height.

My current code :

<ContentView xmlns=""
    <AbsoluteLayout x:Name="signImage" BackgroundColor="Blue">
       <Image />
       <Image />
    <Label x:Name="signTitle" HorizontalTextAlignment="Center" VerticalTextAlignment="Start" TextColor="Gray" FontSize="15"/>
Sign In or Register to comment.