问题描述
我正在尝试为纵向和横向使用相同的视图。我需要框视图位于灰色堆栈布局的中间,在纵向上它可以,但是一旦我切换到水平布局,海蓝宝石框视图就在堆栈布局的末尾。我如何将它放在两个布局的中间?
<ContentPage xmlns="http://xamarin.com/schemas/2014/forms"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
xmlns:local="clr-namespace:AbsolutePath"
x:Class="AbsolutePath.MainPage">
<AbsoluteLayout>
<AbsoluteLayout.Padding>
<OnPlatform x:TypeArguments="Thickness">
<On Platform="iOS">0,20,20</On>
</OnPlatform>
</AbsoluteLayout.Padding>
<!--<BoxView Color="LightGray"
AbsoluteLayout.LayoutBounds="0,1,.35"
AbsoluteLayout.LayoutFlags="All"/>-->
<StackLayout AbsoluteLayout.LayoutBounds=".1,.10,.50" BackgroundColor="LightGray"
AbsoluteLayout.LayoutFlags="All">
<Label Text="$11.95"
TextColor="Black"
FontSize="11"
FontAttributes="Bold"
HorizontalOptions="Start"/>
<BoxView HeightRequest="200" BackgroundColor="Aquamarine" VerticalOptions="Center"
WidthRequest="350"
HorizontalOptions="Center"/>
</StackLayout>
<StackLayout AbsoluteLayout.LayoutBounds="0,.65"
AbsoluteLayout.LayoutFlags="All"
Padding="0,10,0">
<Label Text="Transaction History"
FontSize="15"
FontAttributes="Bold"
HorizontalOptions="Center"/>
<ListView>
<ListView.ItemsSource>
<x:Array Type="{x:Type x:String}">
<x:String>Transaction Item +$15.00 9/9/19</x:String>
<x:String>Transaction Item +$15.00 9/9/19</x:String>
<x:String>Transaction Item +$15.00 9/9/19</x:String>
<x:String>Transaction Item +$15.00 9/9/19</x:String>
<x:String>Transaction Item +$15.00 9/9/19</x:String>
<x:String>Transaction Item +$15.00 9/9/19</x:String>
</x:Array>
</ListView.ItemsSource>
</ListView>
</StackLayout>
</AbsoluteLayout>
</ContentPage>
解决方法
暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!
如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。
小编邮箱:dio#foxmail.com (将#修改为@)