Xamarin表单-自定义ContentPage的工具栏项

问题描述 投票:0回答:1

我需要在ContentPage中的工具栏项内添加标签。

我想为iOS,Android和UWP创建CustomRenderer,但我无法获得每个平台的工具栏视图。

例如,对于Android,我试图获取ActionBar,然后添加标签,但是ActionBar始终为null。

如何创建此CustomRenderer?

谢谢:D

c# xamarin.forms toolbar custom-renderer
1个回答
0
投票

不使用渲染器:

<NavigationPage.TitleView>
  <label text="text"/>
</NavigationPage.TitleView>
© www.soinside.com 2019 - 2024. All rights reserved.