首页 文章

Xaml Xamarin形成绝对布局重叠

提问于
浏览
0

AbsoluteLayoutTemplate

鉴于上面的图像,我将如何设置我的绝对布局?我想让我的蓝色绝对布局重叠红色边框绝对布局 . 我知道有一个doc解释AbsoluteLayouts如何工作,但我仍然不完全理解它100% .

我尝试按以下方式设置布局,但蓝色方块始终隐藏 .

使用下面的代码我根本不会看到蓝色布局 .

<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 回答

  • 0

    在修补后我需要添加蓝色方块布局,我删除了RedSquares父布局 .

    <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>
    

相关问题