I am using the new concept AppShell, and I am doing the following flow
App.MainPage = new AppShell();
then I do
protected async override void OnStart()
{
await Shell.Current.GoToAsync($"//{nameof(LoginPage)}");
}
With this I have a ForgetPasswordPage, from LoginViewModel I do
await Shell.Current.GoToAsync($"//{nameof(ForgetPasswordPage)}");
The point is if I do this
var color = new Color(33, 150, 243);
Xamarin.Essentials.Platform.CurrentActivity.Window.SetStatusBarColor(color);
Inside the Create method from Android the StatusBar has the color I defined. Now where is the method for iOS, like this?
I tried theses solutions
Without succeed...
Someone can explain, how to change the status code but I would like to set it inside my ContentPage, I could use a style, or a simple line of code like this
Xamarin.Essentials.Platform.CurrentActivity.Window.SetStatusBarColor(color);
Which is used in Android project.
I did the steps from the other posts, and I got:
Foundation.MonoTouchException: 'Objective-C exception thrown. Name: NSInternalInconsistencyException Reason: App called -statusBar or -statusBarWindow on UIApplication: this code must be changed as there's no longer a status bar or status bar window. Use the statusBarManager object on the window scene instead. Native stack trace: 0 CoreFoundation 0x00007fff20422fba __exceptionPreprocess + 242
System.Reflection.TargetInvocationException Message=Exception has been thrown by the target of an invocation