Exemplo n.º 1
0
        void ReleaseDesignerOutlets()
        {
            if (DynamicSegmentedContainer != null)
            {
                DynamicSegmentedContainer.Dispose();
                DynamicSegmentedContainer = null;
            }

            if (FixedMultilineSegmentedContainer != null)
            {
                FixedMultilineSegmentedContainer.Dispose();
                FixedMultilineSegmentedContainer = null;
            }

            if (FixedSegmentedContainer != null)
            {
                FixedSegmentedContainer.Dispose();
                FixedSegmentedContainer = null;
            }

            if (BoxSegmentedContainer != null)
            {
                BoxSegmentedContainer.Dispose();
                BoxSegmentedContainer = null;
            }
        }
Exemplo n.º 2
0
        private void CreateBoxSegmentedControl()
        {
            var screenWidth = UIScreen.MainScreen.Bounds.Width;

            var segmentedList   = new List <string>();
            var numberOfOptions = 10;

            for (int i = 1; i <= numberOfOptions; i++)
            {
                segmentedList.Add("Box " + i);
            }

            var SegmentedControl = new DHSegmentedControl(segmentedList);

            SegmentedControl.Font = UIFont.FromName("HelveticaNeue-Medium", 14f);

            var size = new CGSize(screenWidth, 50);

            var rect = new CGRect(BoxSegmentedContainer.Bounds.Location, size);

            SegmentedControl.Frame                      = rect;
            SegmentedControl.SelectionStyle             = DHSegmentedControlSelectionStyle.Box;
            SegmentedControl.SelectionIndicatorLocation = DHSegmentedControlLocation.Down;
            SegmentedControl.SelectionIndicatorColor    = UIColor.Cyan;
            SegmentedControl.TextColor                  = UIColor.DarkGray;
            SegmentedControl.SelectedTextColor          = UIColor.Orange;
            SegmentedControl.BackgroundColor            = UIColor.White;
            SegmentedControl.SegmentEdgeInset           = new UIEdgeInsets(0, 10, 0, 10);
            SegmentedControl.LabelPaddingInset          = new UIEdgeInsets(0, 8, 0, 8);
            SegmentedControl.SelectionIndicatorHeight   = 2.0f;
            SegmentedControl.UserDraggable              = true;
            SegmentedControl.ShouldAnimateUserSelection = true;
            SegmentedControl.SelectedIndex              = 6;
            SegmentedControl.SegmentWidthStyle          = DHSegmentedControlWidthStyle.Dynamic;
            BoxSegmentedContainer.AddSubview(SegmentedControl);
            BoxSegmentedContainer.BackgroundColor = UIColor.Clear;
        }