XAML 如何在HorizontalStackLayout(maui)中将元素在末尾对齐?

ktecyv1j  于 2023-05-27  发布在  其他
关注(0)|答案(1)|浏览(166)

我试图把两个按钮内的HorizontalStackLayout通过使用“HorizontalOptions='End'”但它没有工作这里是代码和结果作为一个图片:

`<VerticalStackLayout Padding="30">
        <Label 
            Text="History"
            VerticalOptions="Start" 
            HorizontalOptions="Start" />
        <Border>
            <HorizontalStackLayout BackgroundColor="Black">
             <Border>
                    <Label VerticalTextAlignment="Center" MaximumWidthRequest="500" TextColor="White" MaximumHeightRequest="60" Text="Lorem Ipsum is simply dummy text of the printing and typesetting industry" />
             </Border>
                <Button  BackgroundColor="Wheat" TextColor="Black" Text="Send" HorizontalOptions="End"/>
                <Button  BackgroundColor="Wheat" TextColor="Black" Text="Delete" HorizontalOptions="End"/>

        </HorizontalStackLayout>
        </Border>
    </VerticalStackLayout>`

kqlmhetl

kqlmhetl1#

对我来说,解决方案是创建一个父元素Grit,列定义=“N,Auto,N”(N只是一个数字,你可以选择它),用这个解决方案,按钮后面没有空间。

相关问题