0
如何添加按鈕,其他頁面上該代碼(這是一個TabbedPage卡的一部分):Xamarin.Forms:巴頓在TabbedPage
this.Children.Add(new ContentPage
{
Title = "Text",
Content = new StackLayout
{
Padding = 20,
VerticalOptions = LayoutOptions.FillAndExpand,
Children =
{
new Image
{
Source = ImageSource.FromFile("image.png")
},
new Label
{
TextColor = Color.FromHex("#5F5A5A"),
FontSize = 16,
Text = "Other text"
}
}
}
});
感謝您的幫助。
確定,但如何添加圖像作爲按鈕的按鈕 – user5734658
只需設置圖像屬性,以所希望的圖象和背景顏色爲透明的。請參閱編輯 – Greensy
第一個代碼不工作/ ImageSource.FromFile不能隱含在xamarin.forms – user5734658