2016-12-13 66 views
0

我有一個AbsoluteLayout,我試圖嵌入一個BoxView。AbsoluteLayout邊界不能正確定位大小大於50的

我通過指定BoxView中的定位:

AbsoluteLayout.SetLayoutFlags(WordThrottle, AbsoluteLayoutFlags.PositionProportional); 
AbsoluteLayout.SetLayoutBounds(WordThrottle, new Rectangle(1.0, 1.0, 70, 70)); 

但是,當我檢查的結果,我得到這個: enter image description here

而不是這樣的:

enter image description here

(該第二張圖片尺寸爲50x50)

尺寸大於50的尺寸在屏幕上似乎也沒有什麼區別。我在這裏錯過了什麼?

編輯:這裏是WordThrottle聲明:

<AbsoluteLayout BackgroundColor="Green"> 
    <mr:BoxView x:Name="WordThrottle" Color="Yellow" WidthRequest="50" HeightRequest="50" VerticalOptions="Start" HorizontalOptions="Start" /> 
</AbsoluteLayout> 
+0

如何WordThrottle聲明? – DavidS

+0

'yourAbsoluteLayout.Padding = 0; yourView.Margin = 0;' – Kowalski

+0

剛剛更新Wordthrottle聲明的帖子 –

回答

0

試試這個

AbsoluteLayout.SetLayoutFlags(WordThrottle, AbsoluteLayoutFlags.PositionProportional); 
AbsoluteLayout.SetLayoutBounds(WordThrottle, new Rectangle(1f, 1f, AbsoluteLayout.AutoSize, AbsoluteLayout.AutoSize));