微信公众号搜"智元新知"关注
微信扫一扫可直接关注哦!

水平布局上的绝对布局

如何解决水平布局上的绝对布局

我正在尝试为纵向和横向使用相同的视图。我需要框视图位于灰色堆栈布局的中间,在纵向上它可以,但是一旦我切换到水平布局,海蓝宝石框视图就在堆栈布局的末尾。我如何将它放在两个布局的中间?

<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 举报,一经查实,本站将立刻删除。