Exemple #1
0
        private void prepareTabBar()
        {
            TabBar.SetHeightPreset(HeightPreset.Normal);
            TabBar.SetDepthPreset(DepthPreset.Depth1);
            TabBar.SetDividerAlignment(DividerAlignment.Top);
            var image = Extensions.ImageWithColor(Color.Clear, new CGSize(1, 1));

            TabBar.ShadowImage     = image;
            TabBar.BackgroundImage = image;
            TabBar.BackgroundColor = Color.White;
        }
Exemple #2
0
        void LayoutSubviews()
        {
            if (TabBar.Items != null)
            {
                foreach (var item in TabBar.Items)
                {
                    if (Device.UserInterfaceIdiom == UIUserInterfaceIdiom.Phone)
                    {
                        if (item.Title == null)
                        {
                            nfloat inset = 7f;
                            item.ImageInsets = new UIEdgeInsets(inset, 0, -inset, 0);
                        }
                        else
                        {
                            nfloat inset = 6f;
                            item.ImageInsets = new UIEdgeInsets(inset, 0, -inset, 0);
                            var offset = item.TitlePositionAdjustment;
                            offset.Vertical = -inset;
                            item.TitlePositionAdjustment = offset;
                        }
                    }
                    else if (item.Title == null)
                    {
                        nfloat inset = 9f;
                        item.ImageInsets = new UIEdgeInsets(inset, 0, -inset, 0);
                    }
                    else
                    {
                        nfloat inset = 3f;
                        item.ImageInsets = new UIEdgeInsets(inset, 0, -inset, 0);
                        var offset = item.TitlePositionAdjustment;
                        offset.Vertical = -inset;
                        item.TitlePositionAdjustment = offset;
                    }
                }
            }

            TabBar.Divider().Reload();
        }
 public virtual void DidSelect(TabBar tabBar, UIButton button)
 {
 }