3
votes

I am using this plugin for display badge count on tab. But some how it's not displaying. I think the problem with Naxam.Bottombar.plugin is used for display tabbar at the bottom in android. Because If I am using default TabbedPage then it works fine. How can I solve this?

I have followed all steps described in the badge plugin.

Code:

<ContentPage xmlns="http://xamarin.com/schemas/2014/forms"
         xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
         x:Class="Graysons.Views.MenuPage" 
         xmlns:local="clr-namespace:Graysons.Customs"
         xmlns:cc="clr-namespace:Graysons.Controls"
         xmlns:vm="clr-namespace:Graysons.ViewModels"  
         xmlns:convertors="clr-namespace:Graysons.Convertors"
         xmlns:controls="clr-namespace:CarouselView.FormsPlugin.Abstractions;assembly=CarouselView.FormsPlugin.Abstractions"
         xmlns:resources="clr-namespace:Graysons.StringResources"  
         xmlns:plugin="clr-namespace:Plugin.Badge.Abstractions;assembly=Plugin.Badge.Abstractions" 
         Title="Menus" Icon="ic_menus.png" plugin:TabBadge.BadgeText="1" plugin:TabBadge.BadgeColor="Red" plugin:TabBadge.BadgePosition="PositionBottomRight" plugin:TabBadge.BadgeMargin="15"
         Style="{StaticResource CustomTopBar}">
..............
</ContentPage>

Also Added Line for rendering badge count in AssemblyInfo.cs file. Any help will be appreciated.

1
Can you show the whole page ? - FreakyAli
Means code of this page? - Srusti Thakkar
Show the custom renderer please - Dennis Schröer
Yes the coce for this page where you have made your tabs - FreakyAli

1 Answers

2
votes

the following renderer to be added Platform specific folders, not in the main project AssemblyInfo.cs

[assembly: ExportRenderer(typeof(TabbedPage), typeof(BadgedTabbedPageRenderer))]

for eg: for iOS.

Sample.iOS/Properties/AssemblyInfo.cs

use this header

using Plugin.Badge.iOS;

then use the renderer

[assembly: ExportRenderer(typeof(TabbedPage), typeof(BadgedTabbedPageRenderer))]

for Android.

Sample.Android/Properties/AssemblyInfo.cs

use this header

using Plugin.Badge.Droid;

then use the renderer

[assembly: ExportRenderer(typeof(TabbedPage), typeof(BadgedTabbedPageRenderer))]