如何在Xamarin表单上使用Microsoft XAML Border

4 xaml xamarin xamarin.forms

我想知道什么是XAML窗体手机"边界"给Xamarin Forms?没有边框可以使用BorderThickness,我想绘制一些"线"并设置在5行的内部.谢谢

XAML Windows Phone:

<Border Grid.Row="0" BorderThickness="0,0,0,2" BorderBrush="#fe98fe"/>

我找到了一个Frame关于xamarin它几乎一样的东西,Border但对我来说并不好看!

Sve*_*übe 5

如果您只想绘制一条线,可以使用BoxView https://developer.xamarin.com/api/type/Xamarin.Forms.BoxView/

高度为2的水平线示例:

<BoxView Color="Red" HeightRequest="2" HorizontalOptions="FillAndExpand"></BoxView>
Run Code Online (Sandbox Code Playgroud)

但目前还没有完整的功能对应的功能Border.

<Grid>
    <Grid.RowDefinitions>
        <RowDefinition Height="*"/>
        <RowDefinition Height="*"/>
        <RowDefinition Height="*"/>
        <RowDefinition Height="*"/>
    </Grid.RowDefinitions>
    <BoxView Grid.Row="0" BackgroundColor="Red" HeightRequest="2" VerticalOptions="End" HorizontalOptions="FillAndExpand"></BoxView>
    <BoxView Grid.Row="1" BackgroundColor="Red" HeightRequest="2" VerticalOptions="End"  HorizontalOptions="FillAndExpand"></BoxView>
    <BoxView Grid.Row="2" BackgroundColor="Red" HeightRequest="2" VerticalOptions="End"  HorizontalOptions="FillAndExpand"></BoxView>
    <BoxView Grid.Row="3" BackgroundColor="Red" HeightRequest="2" VerticalOptions="End"  HorizontalOptions="FillAndExpand"></BoxView>
</Grid>
Run Code Online (Sandbox Code Playgroud)