在导航页面的工具栏中提供背景图像

时间:2015-09-09 10:49:10

标签: image background toolbar xamarin.forms

我是Xamarin.forms的新手,我无法向导航工具栏提供背景图片。 我可以使用ToolbarItems.Add(...)设置标题并在工具栏上添加一个右键。 我的代码段如下

公共类App:应用程序

{

public App()

{

MainPage = new NavigationPage(new Home());

}

}

公共类主页:ContentPage { 公共之家()

{

this.Title =“MyHeader”;

ToolbarItems.Add(new ToolbarItem {...});

}

}

请建议在导航工具栏上提供背景图片的方法。

由于

1 个答案:

答案 0 :(得分:1)

使用NavigationPage,您只能设置:

  • BarBackgroundColor
  • BarTextColor

用于导航工具栏。您应该写下CustomRenderer来实现目标。