Skip to content

Commit

Permalink
looks much better
Browse files Browse the repository at this point in the history
  • Loading branch information
softlion committed Mar 4, 2024
1 parent 445ceb8 commit 862456c
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions Vapolia.SegmentedViews/Platforms/iOS/SegmentedViewHandler.cs
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ static void MapChildren(SegmentedViewHandler handler, ISegmentedView virtualView
{
var segment = virtualView.Children[i];
var width = widths[i];
segmentControl.InsertSegment(segment.GetText(virtualView), i, true);
segmentControl.InsertSegment(segment.GetText(virtualView), i, false);

segmentControl.SetEnabled(true, i);

Expand All @@ -89,7 +89,7 @@ static void MapChildren(SegmentedViewHandler handler, ISegmentedView virtualView
segmentControl.SetWidth((nfloat)width.Value, i);
}
}

MapSelectedIndex(handler, virtualView);
}

Expand All @@ -106,7 +106,9 @@ static void MapSelectedIndex(SegmentedViewHandler handler, ISegmentedView contro
static void MapItemPadding(SegmentedViewHandler handler, ISegmentedView control)
{
var padding = control.ItemPadding;
handler.PlatformView.SetContentPositionAdjustment(new ((nfloat)padding.Left, (nfloat)padding.Top), UISegmentedControlSegment.Any, UIBarMetrics.Default);
// handler.PlatformView.SetContentPositionAdjustment(new ((nfloat)padding.Left, (nfloat)padding.Top), UISegmentedControlSegment.Any, UIBarMetrics.Default);
//TODO
//See https://gist.github.com/nubbel/f675113429b5c7429252
}

static void MapIsEnabled2(SegmentedViewHandler handler, ISegmentedView control)
Expand Down Expand Up @@ -143,7 +145,9 @@ static void MapCharacterSpacing(SegmentedViewHandler handler, ITextStyle control
var kerningAdjustment = control.CharacterSpacing == 0 ? null : (float?)control.CharacterSpacing;
var titleTextAttributes = new UIStringAttributes { KerningAdjustment = kerningAdjustment };
handler.PlatformView.SetTitleTextAttributes(titleTextAttributes, UIControlState.Normal);
titleTextAttributes = new UIStringAttributes { KerningAdjustment = kerningAdjustment };
handler.PlatformView.SetTitleTextAttributes(titleTextAttributes, UIControlState.Disabled);
titleTextAttributes = new UIStringAttributes { KerningAdjustment = kerningAdjustment };
handler.PlatformView.SetTitleTextAttributes(titleTextAttributes, UIControlState.Selected);
}

Expand Down

0 comments on commit 862456c

Please sign in to comment.