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