在 Xamarin.form Xaml 中:当我给 AbsoulteLayout layoutBounds(.5,.5,.5,.5) 时,它位于中心但不适用于 ios... 如果我正在使用 (.75,.75,. 5,.5) 它以 Xamarin 形式 xaml 页面为 ios 而不是 android 的中心.....如何为 ios 和 android 设置相同的 layoutBounds
给定示例:
<AbsoluteLayout BackgroundColor="#99000000"
HorizontalOptions="FillAndExpand"
IsVisible="{Binding xyz}"
VerticalOptions="FillAndExpand">
<AbsoluteLayout x:Name="xyz"
AbsoluteLayout.LayoutBounds="0.5, 0.5, 0.5, 0.5"
AbsoluteLayout.LayoutFlags="All"
BackgroundColor="Transparent"
HorizontalOptions="CenterAndExpand"
VerticalOptions="CenterAndExpand" />
</AbsoluteLayout>
最佳答案
感谢您的回复。
我已经解决了绝对布局的中心对齐问题,希望对你有帮助
<AbsoluteLayout Padding="0" HorizontalOptions="FillAndExpand" VerticalOptions="FillAndExpand" IsVisible="{Binding ShowPopup}">
<BoxView Color="#99000000" AbsoluteLayout.LayoutBounds="0, 0, 1, 1" AbsoluteLayout.LayoutFlags="All" />
<StackLayout x:Name="Popup" Padding="6" Orientation="Horizontal" BackgroundColor="Transparent" AbsoluteLayout.LayoutBounds="0.5, 0.5, -1, -1" AbsoluteLayout.LayoutFlags="PositionProportional">
</StackLayout>
</AbsoluteLayout>
关于xaml - 使用 Xamarin.form Xaml 的 AbsoluteLayout.LayoutBounds 位置,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/38697307/