You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I need to test this scenario:
I have a reference to a tab bar menu in my App.xaml.cs so I can display badges from all over the app calling by calling a method, anyway I can't display any badges no matter what I do, both on iOS and Android, here is my tabbed page :
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Hangover.Pagine;
using Plugin.Badge.Abstractions;
using Xamarin.Forms;
using Xamarin.Forms.PlatformConfiguration.AndroidSpecific;
using Xamarin.Forms.Xaml;
namespace Hangover
{
[XamlCompilation(XamlCompilationOptions.Compile)]
public partial class Menu : Xamarin.Forms.TabbedPage
{
private List pagine = new List();
public Menu()
{
InitializeComponent();
On<Xamarin.Forms.PlatformConfiguration.Android>().SetToolbarPlacement(ToolbarPlacement.Bottom);
this.On<Xamarin.Forms.PlatformConfiguration.Android>().SetIsSwipePagingEnabled(false);
this.pagine = new List<NavigationPage>() {
new NavigationPage(new cp_PaginaUno()){
Icon = "Eventi.png",
Title = "Uno",
BarBackgroundColor = Color.White,
BarTextColor = Color.FromHex("#FF7F00")
},
new NavigationPage(new cp_PaginaDue()){
Icon = "Search.png",
Title = "Due",
BarBackgroundColor = Color.White,
BarTextColor = Color.FromHex("#FF7F00")
}
};
foreach (NavigationPage pagina in pagine)
{
this.Children.Add(pagina);
}
}
/// <summary>
/// Imposta il numero di una pagina contenuta nel menu
/// </summary>
/// <returns><c>true</c>, if page badge value was set, <c>false</c> otherwise.</returns>
public bool setBadgePagina(String pageName, Object value)
{
foreach (NavigationPage pagina in pagine)
{
if (pagina.CurrentPage.GetType().Name.Equals(pageName))
{
TabBadge.SetBadgeText(pagina, "1+");
TabBadge.SetBadgeColor(pagina, Color.FromHex("#A0FFA500"));
TabBadge.SetBadgeText(pagina.CurrentPage, "1+");
TabBadge.SetBadgeColor(pagina.CurrentPage, Color.FromHex("#A0FFA500"));
}
}
foreach (Page page in this.Children)
{
var x = page as NavigationPage;
if (x.CurrentPage.GetType().Name.Equals(pageName))
{
TabBadge.SetBadgeText(x, "1+");
TabBadge.SetBadgeColor(x, Color.FromHex("#A0FFA500"));
TabBadge.SetBadgeText(x.CurrentPage, "1+");
TabBadge.SetBadgeColor(x.CurrentPage, Color.FromHex("#A0FFA500"));
}
}
return false;
}
}
}
To try to display the badge I call from one page the setBadgePagina method:
I need to test this scenario:
I have a reference to a tab bar menu in my App.xaml.cs so I can display badges from all over the app calling by calling a method, anyway I can't display any badges no matter what I do, both on iOS and Android, here is my tabbed page :
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Hangover.Pagine;
using Plugin.Badge.Abstractions;
using Xamarin.Forms;
using Xamarin.Forms.PlatformConfiguration.AndroidSpecific;
using Xamarin.Forms.Xaml;
namespace Hangover
{
[XamlCompilation(XamlCompilationOptions.Compile)]
public partial class Menu : Xamarin.Forms.TabbedPage
{
private List pagine = new List();
}
To try to display the badge I call from one page the setBadgePagina method:
public cp_PaginaUno()
{
InitializeComponent();
}
nothing displayed.
Xamarin.Forms 4.4.0(last)
Plugin.Badge 2.2.1
The text was updated successfully, but these errors were encountered: