Quantcast
Channel: Xamarin.Forms — Xamarin Community Forums
Viewing all articles
Browse latest Browse all 58056

Absolute Layout Xaml Question (Bug?)

$
0
0

Hi, would appreciate some assistance with the following, not sure if its a bug or if I'm misunderstanding the use of LayoutBounds for AbsoluteLayout in Xaml.

I'm trying to arrange 5 columns of equal size (20% width) and different colour across the display using Absolute Layout as per the Xaml below. The width (0.2) is being observed fine, but the BoxViews are overlapping and displaying too far to the left even though I'm spacing them 0.2 apart... image attached.

With the Xaml below should they not be appearing next to each other and fill the display?
Is this a bug or am I missing something? Help?

Tx, Leon

    <AbsoluteLayout Grid.Row="0" Grid.Column="0" BackgroundColor="White">               
        <BoxView Color="Purple" AbsoluteLayout.LayoutBounds ="0, 0, 0.2 ,1" AbsoluteLayout.LayoutFlags="All" />
        <BoxView Color="Red"     AbsoluteLayout.LayoutBounds ="0.2, 0, 0.2, 1" AbsoluteLayout.LayoutFlags="All" />
        <BoxView Color="Green" AbsoluteLayout.LayoutBounds  ="0.4, 0, 0.2, 1" AbsoluteLayout.LayoutFlags="All" />
        <BoxView Color="Blue"    AbsoluteLayout.LayoutBounds ="0.6, 0, 0.2, 1" AbsoluteLayout.LayoutFlags="All" />
        <BoxView Color="Black"  AbsoluteLayout.LayoutBounds  = "0.8 , 0, 0.2, 1" AbsoluteLayout.LayoutFlags="All" />
    </AbsoluteLayout>

Viewing all articles
Browse latest Browse all 58056

Trending Articles