0
votes

AbsoluteLayoutTemplate

Given the above image, how would I go about to setup my Absolute Layouts? I would like to have my blue absolute layout overlap the red border absolute layout. I understand there's a doc explaining how AbsoluteLayouts work however I still don't completely understand it 100%.

I have tried setting up the layouts the following way but the blue square is always hidden.

With the below code I don't end up seeing the blue layout at all.

<AbsoluteLayout>
 <AbsoluteLayout x:Name="BlueSquare">
    <StackLayout> (Asumme there is a list of things in here) </StackLayout>
 </AbsoluteLayout>
 <AbsoluteLayout x:Name="RedBorderArea">
    <StackLayout> (Asumme there is another list of stuff in here) </StackLayout>
 </AbsoluteLayout>
</AbsoluteLayout>
1
Have you tried experimenting with the Z-Index of the 'BlueSquare' absolute layout? - Digitalsa1nt
If by z-index you are referring to the order I add the children I guess I can try to call this method. developer.xamarin.com/api/member/… I am not sure if this is the right solution however. - Matthew
well given the information provided above, I know what you want it to look like, but I don't know what it 'actually' looks like. When you say the blue square is hidden I assume that you can see it, but that it's behind your red square. In which case the first thing to look into is it's layout along the Z-axis. =) - Digitalsa1nt

1 Answers

0
votes

After tinkering around I needed to add the Blue square layout last and i removed the RedSquares parent layout.

<AbsoluteLayout>
    <StackLayout x:Name="RedBorderArea" AbsoluteLayout.LayoutFlags="All" AbsoluteLayout.LayoutBounds="0.5,0.5,1,1"> (Asumme there is another list of stuff in here) </StackLayout>
    <AbsoluteLayout x:Name="BlueSquare" LayoutFlags="PositionProportional, WidthProportional" LayoutBounds="1,0,1,1">
       <StackLayout> (Asumme there is a list of things in here) </StackLayout>
    </AbsoluteLayout>
</AbsoluteLayout>