Beispiel #1
0
        private BottomBar CreateBottomBar(IEnumerable <Page> pageIntents)
        {
            var bar = new BottomBar(Context);

            // TODO: Configure the bottom bar here according to your needs

            bar.SetOnTabClickListener(this);
            bar.UseFixedMode();
            bar.NoTabletGoodness();
            bar.NoTopOffset();
            PopulateBottomBarItems(bar, pageIntents);

            bar.ItemContainer.SetBackgroundColor(Xamarin.Forms.Color.FromHex("#fafafa").ToAndroid());

            //bar.SetTextAppearance(
            //    Device.Idiom == TargetIdiom.Phone ? Resource.Style.TextAppearance_Small : Resource.Style.TextAppearance_Small_ForTablet
            //);
            for (int i = 0; i < bar.ItemContainer.ChildCount; i++)
            {
                var child = bar.ItemContainer.GetChildAt(i);
                child.SetPadding(0, 0, 0, 0);
            }

            return(bar);
        }