I want to remove my icon from action bar, I'm using a MasterDetail page to create a slider, I'm using the left icon to open the slider, but the right smaller icon sided of "APP Vendas" I want to remove, I tryied everything on C# to easly remove without success. Tryiend tranpatent, RGBA, None, etc, here is my code and Image:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Xamarin.Forms;
using App5.Menu;
using App5.Categorias;
using App5;
namespace App5
{
public class MainPage : MasterDetailPage
{
public MainPage()
{
var menuPage = new MenuPage();
menuPage.OnMenuTap = (page) =>
{
IsPresented = false;
Detail = new NavigationPage(page);
};
Master = menuPage;
Detail = new NavigationPage(new Resumo())
{
BarBackgroundColor = Color.Black,
Icon = None
};
}
}
}
You need to just add those single line code in MainActivity.cs
file in your Android project.
ActionBar.SetIcon(Android.Resource.Color.Transparent);
For Example
using Android.OS;
using Android.Content.PM;
namespace Test.Droid
{
[Activity(Label = "test", Icon = "@drawable/icon", MainLauncher = true, ConfigurationChanges = ConfigChanges.ScreenSize | ConfigChanges.Orientation)]
public class MainActivity : global::Xamarin.Forms.Platform.Android.FormsApplicationActivity
{
protected override void OnCreate(Bundle bundle)
{
base.OnCreate(bundle);
global::Xamarin.Forms.Forms.Init(this, bundle);
ActionBar.SetIcon(Android.Resource.Color.Transparent);
LoadApplication(new App());
}
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With