我想通過Codebihnd中的AbsoluteLayout在BoxView組件上添加文本。 類似這樣的: 如何將標籤文本添加到圓括號框中
我該怎麼辦?
這裏是我的代碼,在那裏我把absoluteLayout到stackLayout底:
public TestPageBoxView()
{
StackLayout sl = new StackLayout();
AbsoluteLayout al = new AbsoluteLayout();
BoxView bv = new BoxView { BackgroundColor = Color.Green };
Label l = new Label { Text = "Some text with \n breaks" };
AbsoluteLayout.SetLayoutBounds(l, new Rectangle(0, 0,1,1));
AbsoluteLayout.SetLayoutFlags(l, AbsoluteLayoutFlags.All);
sl.Children.Add(bv);
sl.Children.Add(al);
Content = sl;
}
所以,我擔心的是,這個L成分粘到stacklayout而不是BoxView中。
也許我應該嘗試RelativeLayout的?
你知道混帳一些組件?像XLabs?
謝謝。
其實我的應用程序,我用來代替按鈕 –
@MikeDarwish的ImageButton有任何限制,沒有ü檢查例如多少大的文本可以持有? Tnx – Stefan0309
標準圖像按鈕有限制。它大多不適合。在Mozilla中有一些開放的bug,如果你想在圖像中使用文本,它只在圖像右側放置文本。我記得上次不可能改變。如果您需要圖像按鈕,則應該使用輕拍手勢識別器的圖像。 – batmaci