I wrote a small custom Renderer for iOS that is able to change the StatusBar Text Color whenever i need it for a certain Page. The renderer is just a basic PageRenderer
and according to other SO questions and the iOS docs what you should do is the following:
public override void ViewWillAppear(bool animated)
{
base.ViewWillAppear(animated);
//Call this method
this.SetNeedsStatusBarAppearanceUpdate();
}
public override UIStatusBarStyle PreferredStatusBarStyle()
{
//This should be called and you should be able to return you desired style
}
However the PreferredStatusBarStyle
override method is never called.
After some more research the reason for this is most certainly the fact, that my Page is wraped in a NavigationPage. There's a solution in Swift to call extensions on the NavigationControllers, like described in this SA post: link
I have no idea how an extension like this can be made in my custom renderer. If anyone has a clue I'd be happy to hear it. I couldn't find anything on that topic.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…