2
在一個RelativeLayout的內部我想在StackLayout的頂部顯示一些元素,並在另一個StackLayout的屏幕底部顯示一些元素。 (我使用相對的,因爲我也有一個圖像將重疊的頂部的一部分)如何設置底部StackLayout約束是關於父佈局的底部?將堆棧對齊到RelativeLayout的底部?
這是我試過,但它不工作:
<RelativeLayout x:Name="Login" BackgroundColor="#f6f6f6">
<StackLayout Orientation="Vertical" HorizontalOptions="FillAndExpand" BackgroundColor="White"
RelativeLayout.WidthConstraint="{ConstraintExpression Type=RelativeToParent, Property=Width, Factor=1}"
RelativeLayout.YConstraint="{ConstraintExpression Type=RelativeToParent, Property=Y, Constant=0}"
>
<Image Source="ACSBanner.png" VerticalOptions="Center" HorizontalOptions="Center" />
</StackLayout>
<StackLayout Orientation="Vertical" HorizontalOptions="FillAndExpand" VerticalOptions="EndAndExpand">
<Label Text="Sample Text For Bottom" FontSize="Large" TextColor="Black" FontAttributes="Bold"/>
</StackLayout>
</RelativeLayout>