SegmentedControl icon indicating copy to clipboard operation
SegmentedControl copied to clipboard

TintColor doesn't work in iOS 13

Open mrxten opened this issue 5 years ago • 3 comments

It seems iOS 13 has new style for this control. image I did set another color for tint. XF 4.2 SegmentedControl 2.0.1

mrxten avatar Sep 24 '19 12:09 mrxten

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;

LeoJHarris avatar Sep 25 '19 01:09 LeoJHarris

@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

AbdellahMobiArchitects avatar Oct 31 '19 13:10 AbdellahMobiArchitects

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/

EmmanVazz avatar Mar 05 '20 23:03 EmmanVazz