xabre / xamarin-forms-tab-badge

Xamarin Forms bindable Tab badges for iOS, Android, UWP, MacOS and WPF
MIT License
307 stars 75 forks source link

Not Showing Badge icon ,Badge Color and Badge Text #35

Closed sumitsisodia007 closed 7 years ago

sumitsisodia007 commented 7 years ago

Hi, I am using VS-2017 and update Xamarin Form Latest version. i am using badge plugins 1.3.0 pre or 1.1.3 but not showing badge icon ,text and color. what should i do any body can help me . screenshot_1504069434

Thanks for advance .

benevbright commented 7 years ago

Same here, I have no idea when it stopped working?! I just noticed somehow that the badge is not showing.

Tested on Android. XF ver : 2.3.4.270 stable badge plugin : 1.1.3 tested device : Samsung Galaxy S4 - Android 5.0.1 Android SDK : 7.1(API 25)

Can we expect quick fix for this? Thanks.

xabre commented 7 years ago

I would fix it asap but, unfortunately I'm not able to reproduce it on my device/emulator.... Do you get any errors in your output/logcat?

benevbright commented 7 years ago

Hi Adrian,

Yes. You are right. I downloaded the sample and tested it after I updated all packages as I said above. It turns out it works fine.

I should check again what did I mistake. I'm sorry about it and thanks.

benevbright commented 7 years ago

Caution - Custom TabbedPage / Custom Renderers

If you are using a custom renderer for TabbedPage please change it to inherit from BadgedTabbedPageRenderer and you are all set. Of course dont forget to register your own renderer.

Hi, I found my mistake. I don't know since when my code has changed, but my TabbedPageRenderer didn't inherit from BadgedTabbedPageRenderer.

I changed it and the problem is gone.

I'm sorry.

xabre commented 7 years ago

I'm going to close this issue for now. Feel free to repopen it if you find a bug.

kamranmasud commented 4 years ago

I would fix it asap but, unfortunately I'm not able to reproduce it on my device/emulator.... Do you get any errors in your output/logcat?

I want to show badge on cart tab..on the other side i want to show root page on tab clicked or reselected..I am using your plugin to show badge on tab but when i use renderer to show root page on tab reselected then badge is not visible. I am finding the solution because i want both of these functionalities in my app.. I am using the following renderer to navigate to root page when i reselect tab:

[assembly: ExportRenderer(typeof(TabPage), typeof(MainPageRenderer))] namespace MyProject.Droid.Renderers { public class MainPageRenderer : TabbedPageRenderer, TabLayout.IOnTabSelectedListener { private TabPage _page; protected override void OnElementChanged(ElementChangedEventArgs e) { base.OnElementChanged(e); if (e.NewElement != null) { _page = (TabPage)e.NewElement; } else { _page = (TabPage)e.OldElement; }

}
async void TabLayout.IOnTabSelectedListener.OnTabReselected(TabLayout.Tab tab)
{
    await _page.CurrentPage.Navigation.PopToRootAsync();
}

} }

When i comment this code then badge will visible otherwise not