0

I need to add a label inside a toolbar item in a ContentPage.

I would like to create a CustomRenderer for iOS, Android and UWP, but I can't get the toolbar view for each platform.

For example, for Android I have tried to get the ActionBar and then add the label, but the ActionBar is always null.

How can I create this CustomRenderer?

Thank you :D

Hikari
  • 589
  • 7
  • 29
  • Is there a specific reason why you are not using the standard TabbedPage from Xamarin Forms? In general if a class already has a cross-platform implementation in Forms it's harder to make your own custom renderer of it function without weird bugs – InvalidReferenceException Mar 22 '19 at 14:17
  • What kind of effect do you want for `ToolBarItems`?.https://learn.microsoft.com/en-us/dotnet/api/xamarin.forms.page.toolbaritems?view=xamarin-forms You can show image for different devices? – Junior Jiang Mar 25 '19 at 09:45
  • Hi, no I need to show a fixed text get from a XML file. – Hikari Mar 25 '19 at 11:51
  • Adding a sample of your UI requirement would help – Nikhileshwar Dec 13 '19 at 14:16

1 Answers1

1

Without using renderer:

<NavigationPage.TitleView>
  <label text="text"/>
</NavigationPage.TitleView>
STG
  • 93
  • 5