private void TabSetup(ActionBar.Tab tab, int resourceID, bool isSelected)
        {
            ImageView iv = new ImageView(activity);

            iv.SetImageResource(resourceID);
            iv.SetPadding(0, 10, 0, 0);

            try
            {
                tab.TabSelected += Tab_TabSelected;
            }
            catch (System.Exception)
            {
            }

            tab.TabUnselected += Tab_TabUnselected;

            if (isSelected)
            {
                iv.SetColorFilter(selectionColor);
            }
            else
            {
                iv.SetColorFilter(unselectionColor);
            }

            tab.SetCustomView(iv);
        }
Beispiel #2
0
        private void TabSetup(ActionBar.Tab tab, int resourceID)
        {
            ImageView iv = new ImageView(activity);

            iv.SetImageResource(resourceID);
            iv.SetPadding(0, 10, 0, 0);

            tab.SetCustomView(iv);
        }
        private void TabSetup(ActionBar.Tab tab, int resourceID)
        {
            ImageView iv = new ImageView(activity);

            iv.SetImageResource(resourceID);
            //iv.SetPadding(-50, 10, -50, 20);
            iv.SetPadding(-35, 8, -35, 16);
            iv.SetMinimumWidth(20);
            tab.SetCustomView(iv);
        }
Beispiel #4
0
        void TabSetup(ActionBar.Tab tab, int resID)
        {
            var linLay = new LinearLayout(activity)
            {
                LayoutParameters = new LayoutParams(LayoutParams.WrapContent, 180),
                Orientation      = Orientation.Vertical,
            };

            linLay.SetHorizontalGravity(Android.Views.GravityFlags.Center);
            var imageView = new ImageView(activity);

            imageView.SetImageResource(resID);
            imageView.SetPadding(-35, 4, -35, 0);
            imageView.SetMinimumWidth(60);

            var textView = new TextView(activity)
            {
                Text = tab.Text
            };

            linLay.AddView(imageView);
            linLay.AddView(textView);
            tab.SetCustomView(linLay);
        }