Xamarin.Forms Ellipse 绘制矩形而不是椭圆
Xamarin.Forms Ellipse draws a rectangle rather than an ellipse
我在 XF 5.0.0.2012...
每当我尝试使用新的椭圆元素时,无论我尝试什么,它都只会绘制一个矩形。其他人遇到过这个问题吗?我在 iOS 上看到了这个。我的项目没有 android 项目可以比较。
<Grid x:Name="MyGrid" RowSpacing="0" ColumnSpacing="0">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="4*"/>
<ColumnDefinition Width="6*"/>
</Grid.ColumnDefinitions>
<Grid.RowDefinitions>
<RowDefinition
Height="*" />
<RowDefinition
Height="*" />
<RowDefinition
Height="*" />
<RowDefinition
Height="*" />
<RowDefinition
Height="*" />
<RowDefinition
Height="*" />
</Grid.RowDefinitions>
<Ellipse StrokeThickness="2" Grid.Row="0" Grid.ColumnSpan="2" BackgroundColor="White" HorizontalOptions="Center" VerticalOptions="Center" HeightRequest="20" WidthRequest="50"></Ellipse>
</Grid>
将BackgroundColor
替换为Stroke
,(或Fill
),更多详情见ellipse
<Ellipse
Grid.Row="0"
Grid.ColumnSpan="2"
WidthRequest="50"
HeightRequest="20"
HorizontalOptions="Center"
VerticalOptions="Center"
Stroke="White"
StrokeThickness="2" />
此外,您可以在 XF5.0 中像这样执行 ColumnDefinitions
和 RowDefinitions
:
<Grid ColumnDefinitions="4*, 6*" RowDefinitions="*, *, *, *, *, *">
我在 XF 5.0.0.2012...
每当我尝试使用新的椭圆元素时,无论我尝试什么,它都只会绘制一个矩形。其他人遇到过这个问题吗?我在 iOS 上看到了这个。我的项目没有 android 项目可以比较。
<Grid x:Name="MyGrid" RowSpacing="0" ColumnSpacing="0">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="4*"/>
<ColumnDefinition Width="6*"/>
</Grid.ColumnDefinitions>
<Grid.RowDefinitions>
<RowDefinition
Height="*" />
<RowDefinition
Height="*" />
<RowDefinition
Height="*" />
<RowDefinition
Height="*" />
<RowDefinition
Height="*" />
<RowDefinition
Height="*" />
</Grid.RowDefinitions>
<Ellipse StrokeThickness="2" Grid.Row="0" Grid.ColumnSpan="2" BackgroundColor="White" HorizontalOptions="Center" VerticalOptions="Center" HeightRequest="20" WidthRequest="50"></Ellipse>
</Grid>
将BackgroundColor
替换为Stroke
,(或Fill
),更多详情见ellipse
<Ellipse
Grid.Row="0"
Grid.ColumnSpan="2"
WidthRequest="50"
HeightRequest="20"
HorizontalOptions="Center"
VerticalOptions="Center"
Stroke="White"
StrokeThickness="2" />
此外,您可以在 XF5.0 中像这样执行 ColumnDefinitions
和 RowDefinitions
:
<Grid ColumnDefinitions="4*, 6*" RowDefinitions="*, *, *, *, *, *">