【发布时间】:2017-07-20 23:15:00
【问题描述】:
鉴于上图,我将如何设置我的绝对布局? 我想让我的蓝色绝对布局与红色边框绝对布局重叠。我知道有一个 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>
【问题讨论】:
-
您尝试过使用“BlueSquare”绝对布局的 Z-Index 吗?
-
如果z-index指的是我添加孩子的顺序,我想我可以尝试调用这个方法。 developer.xamarin.com/api/member/… 不过我不确定这是否是正确的解决方案。
-
鉴于上面提供的信息,我知道您希望它是什么样子,但我不知道它“实际”是什么样子。当你说蓝色方块被隐藏时,我假设你可以看到它,但它在你的红色方块后面。在这种情况下,首先要研究的是它沿 Z 轴的布局。 =)
标签: forms xaml xamarin xamarin.forms