在我更新到Xamarin.Forms 5.0后,这行代码被破坏了:
<AbsoluteLayout.LayoutBounds>
<OnPlatform x:TypeArguments="Rectangle">
<On Platform="Android">0.5,0.49,0.4,0.5</On>
<On Platform="iOS">0.5,0.52,0.4,0.5</On>
</OnPlatform>
</AbsoluteLayout.LayoutBounds>
我能做些什么来修复它?
关于按平台设置AbsoluteLayout.LayoutBounds,您可以尝试以下代码:
<AbsoluteLayout Margin="20">
<BoxView AbsoluteLayout.LayoutBounds="{OnPlatform Android='0,10,200,5', iOS='0,0,.5,.5'}" Color="Silver">
</BoxView>
</AbsoluteLayout>