请问为什么Frame
不遵循HeightRequest
或WidthRequest
属性?
在其他控件中使用这些属性时,它们的效果是符合预期的。
例如,在此XAML中,我使用了一个Frame
和一个BoxView
:
<StackLayout Orientation="Horizontal"
HorizontalOptions="CenterAndExpand"
Padding="10">
<Frame VerticalOptions="Center"
HeightRequest="5"
WidthRequest="5"
BackgroundColor="Red"/>
<BoxView VerticalOptions="Center"
HeightRequest="5"
WidthRequest="5"
Color="Blue"/>
</StackLayout>
结果如下:
Frame的尺寸和方框的尺寸之间存在很大差异,但实际上不应该有这种情况发生。