我如何将50%的控制权放在菜单栏上50%的图像视图中,并将50%的控制权放在页面上,就像屏幕截图一样?
我尝试使用相对布局实现此目的但无法做到这一点.. 请有人知道帮我设计这样的UI。
<Button HeightRequest="50" WidthRequest="50" BorderRadius="35" BackgroundColor="Aqua"
RelativeLayout.XConstraint= "{ConstraintExpression Type=RelativeToParent, Property=Width, Factor = .5}"
RelativeLayout.YConstraint="{ConstraintExpression Type=RelativeToParent, Property=Height, Factor = -.05}" />
答案 0 :(得分:0)
您可以使用绝对布局
来完成此操作 <AbsoluteLayout BackgroundColor="white">
<BoxView BackgroundColor="Aqua" AbsoluteLayout.LayoutBounds="0
0,1,100" AbsoluteLayout.LayoutFlags="XProportional,YProportional,WidthProportional" />
<Button BackgroundColor="White"
AbsoluteLayout.LayoutBounds=".5,75,70,70" AbsoluteLayout.LayoutFlags="XProportional" BorderRadius="35" />
<Button BackgroundColor="Red" AbsoluteLayout.LayoutBounds=".5
80,60,60" AbsoluteLayout.LayoutFlags="XProportional" BorderRadius="30" />
</AbsoluteLayout>