SegmentedControl
SegmentedControl copied to clipboard
TintColor doesn't work in iOS 13
It seems iOS 13 has new style for this control.
I did set another color for tint.
XF 4.2
SegmentedControl 2.0.1
Changes required for new styling see here: https://stackoverflow.com/a/56874473
I think something like this:
...
public SegmentedControlRenderer()
{
TintColor = UIColor.White;
}
...
nativeSegmentedControl.SetTitleTextAttributes(new UITextAttributes()
{
TextColor = UIColor.White
}, UIControlState.Normal);
nativeSegmentedControl.SetTitleTextAttributes(new UITextAttributes()
{
TextColor = UIColor.Black
}, UIControlState.Selected);
if (UIDevice.CurrentDevice.CheckSystemVersion(13, 0))
{
nativeSegmentedControl.SelectedSegmentTintColor = UIColor.White;
nativeSegmentedControl.BackgroundColor = UIColor.Clear;
}
nativeSegmentedControl.SelectedSegment = 0;
@alexrainman I'm having the same issue as well I would love it if an official stable nuget update is released for this.
For the time being, i'm using this one: https://github.com/1iveowl/Plugin.SegmentedControl#credits
This plugin doesn't seem to be actively maintained but here is a workaround for this issue https://xamarinhowto.com/making-ios-13-segmented-controls-prettier-in-xamarin-forms/