我有一个AbsoluteLayout,我正在尝试嵌入BoxView。
我通过以下方式分配BoxView的定位:
AbsoluteLayout.SetLayoutFlags(WordThrottle, AbsoluteLayoutFlags.PositionProportional);
AbsoluteLayout.SetLayoutBounds(WordThrottle, new Rectangle(1.0, 1.0, 70, 70));
而不是:
(第二张图片大小为50x50)
大于50的尺寸在屏幕上似乎也没有任何差异。我在这里缺少什么?
编辑:这是WordThrottle的声明:
<AbsoluteLayout BackgroundColor="Green">
<mr:BoxView x:Name="WordThrottle" Color="Yellow" WidthRequest="50" HeightRequest="50" VerticalOptions="Start" HorizontalOptions="Start" />
</AbsoluteLayout>
答案 0 :(得分:0)
试试这个
AbsoluteLayout.SetLayoutFlags(WordThrottle, AbsoluteLayoutFlags.PositionProportional);
AbsoluteLayout.SetLayoutBounds(WordThrottle, new Rectangle(1f, 1f, AbsoluteLayout.AutoSize, AbsoluteLayout.AutoSize));