I have Navigation Drawer in my application, so I run into issue that Bottom Navigation Bar is above the Navigation Drawer. So, following your suggestion:
All you need to do is instead of attaching the BottomBar to your Activity, attach it to the view that has your content. For example, if your fragments are in a ViewGroup that has the id fragmentContainer
So I did just that:
protected override void OnCreate(Bundle bundle)
{
// Some stuff
bottomBar = BottomBar.Attach(this.FindViewById<FrameLayout>(Resource.Id.fragmentContainer), bundle);
bottomBar.SetItems(Resource.Menu.bottombar_menu);
bottomBar.SetOnMenuTabClickListener(this);
bottomBar.SetGravity(GravityFlags.Bottom);
var layoutParams = new FrameLayout.LayoutParams(ViewGroup.LayoutParams.MatchParent, ViewGroup.LayoutParams.WrapContent);
layoutParams.Gravity = GravityFlags.Bottom;
bottomBar.LayoutParameters = layoutParams;
bottomBar.NoTopOffset();
// Make a Badge for the first tab, with red background color and a value of "13".
BottomBarBadge unreadMessages = bottomBar.MakeBadgeForTabAt(0, "#FF0000", 13);
// Control the badge's visibility
unreadMessages.Show();
unreadMessages.Hide();
// Change the displayed count for this badge.
unreadMessages.Count = 4;
// Change the show / hide animation duration.
unreadMessages.AnimationDuration = 200;
// If you want the badge be shown always after unselecting the tab that contains it.
unreadMessages.AutoShowAfterUnSelection = true;
var fragment = this.FragmentManager.BeginTransaction();
fragment.AddToBackStack(null);
fragment.Add(Resource.Id.fragmentContainer, new CustomFragment());
fragment.Commit();
}
Either I am doing something wrong or in some specific combination of views this issue persists.
Looking forward to some explanation why it is happening.
I have Navigation Drawer in my application, so I run into issue that Bottom Navigation Bar is above the Navigation Drawer. So, following your suggestion:
So I did just that:
But unfortunately in result the Bottom Navigation Bar is visible, but the content of Fragment is not.
I checked UI Hierarchy, my fragment content is not even added.
I also tried adding just simple LinearLayout under the view I attached Bottom Navigation Bar, it was also overriden by the Bottom Navigation Bar.
Here is my AXML for main activity view:
Either I am doing something wrong or in some specific combination of views this issue persists. Looking forward to some explanation why it is happening.