一種替代我使用的相對佈局方法:
這基本上使用彼此重疊並填充可用的空間中的圖像和一個堆棧佈局。內部堆棧佈局然後能夠從最後擴展。如果要創建向上擴展的「最大」數量(例如圖像的最大50%),可以將外部佈局更改爲「layoutBounds 1,1,1,.5」
下面的代碼使用背景顏色所以你可以很容易地看到它,如果複製。 大量修改選項,例如使用背景圖像和堆疊佈局以外的其他項目,例如框架。
<AbsoluteLayout HorizontalOptions="FillAndExpand" VerticalOptions="FillAndExpand">
<Image BackgroundColor="Red" AbsoluteLayout.LayoutBounds="1,1,1,1" AbsoluteLayout.LayoutFlags="All" Aspect="AspectFill"></Image>
<StackLayout AbsoluteLayout.LayoutBounds="1,1,1,1" AbsoluteLayout.LayoutFlags="All" BackgroundColor="Transparent">
<StackLayout BackgroundColor="Blue" HorizontalOptions="FillAndExpand" VerticalOptions="EndAndExpand" Orientation="Vertical">
<Label Text="Label 1"></Label>
<Label Text="Label 2"></Label>
</StackLayout>
</StackLayout>
</AbsoluteLayout>
[Xamarin在底部形成相對佈局位置stacklayout]的可能重複(http://stackoverflow.com/questions/42919941/xamarin-forms-relative-layout-position-stacklayout-at-bottom) –