How to change status bar icons color in IOS version under 13 - Xamarin Forms?

Viewed 330

i just can't change the status bar icons color in IOS version under 13 of my Xamarin Forms App. I do this already and works great with IOS version above 13. I could change the background color but i don't need it, i need the icons itself.

Look at the example: This code just works to change the status bar BackgroundColor, i set the status.TintColor but it does not changes...

private void ChangeStatusBar()
    {
        UIView statusBar = UIApplication.SharedApplication.ValueForKey(new NSString("statusBar")) as UIView;
        if (statusBar.RespondsToSelector(new ObjCRuntime.Selector("setBackgroundColor:")))
        {
            statusBar.BackgroundColor = UIColor.White;
            statusBar.TintColor = UIColor.White;
            UIApplication.SharedApplication.StatusBarStyle = UIStatusBarStyle.LightContent;
        }
    }

I use this to change the status bar icons color in IOS version above 13 and works ok:

 UIApplication.SharedApplication.SetStatusBarStyle(isLightTheme ? UIStatusBarStyle.LightContent : UIStatusBarStyle.DarkContent, false);
            GetCurrentViewController().SetNeedsStatusBarAppearanceUpdate();
1 Answers

Make sure that you had added the key-value description in info.plist

View controller-based status bar appearance as No (the default value is Yes).

enter image description here

Related