Esempio n. 1
0
 public FormsSegmentView(Context context, SegmentView element) : base(context)
 {
     _context         = context;
     _element         = element;
     Orientation      = Android.Widget.Orientation.Horizontal;
     LayoutParameters = new RadioGroup.LayoutParams(LayoutParams.MatchParent, LayoutParams.WrapContent);
     CheckedChange   += FormsSegmentView_CheckedChange;
     InitializeColors();
     PopulateSegments();
 }
            private void RemoveButton(SegmentedGroup group)
            {
                if (group.ChildCount < 1)
                {
                    return;
                }
                group.RemoveViewAt(group.ChildCount - 1);
                group.UpdateBackground();

                //Update margin for last item
                if (group.ChildCount < 1)
                {
                    return;
                }
                RadioGroup.LayoutParams layoutParams = new RadioGroup.LayoutParams(ViewGroup.LayoutParams.WrapContent, ViewGroup.LayoutParams.WrapContent);
                layoutParams.SetMargins(0, 0, 0, 0);
                group.GetChildAt(group.ChildCount - 1).LayoutParameters = layoutParams;
            }