-
Notifications
You must be signed in to change notification settings - Fork 1.9k
[iOS] Allow VC renderers of FlyoutPage to specify UIStatusBarStyle #13143
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
|
||
public override UIViewController ChildViewControllerForStatusBarStyle() | ||
{ | ||
return ChildViewControllers?.LastOrDefault() ?? base.ChildViewControllerForStatusBarStyle(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ChildViewControllers is an array - can we just check the last index instead of allocating an enumerator?
Also, are we guaranteed that the last controller in the array is the correct one?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed it @hartez , this ChildVIewController wrapper is internal and we are the only ones adding to it the detail or flout as a children, it's the only children.
Is it possible that a fix like this would be needed for the Shell too? I'm using a Shell and cannot change the color of the status bar text using PreferredStatusBarStyle on any of the pages I navigate to |
Description of Change
Since we were wrapping the renderers of FlyoutPage and DetailPage on a internal ViewController, the users couldn't provide overrides for
PreferredStatusBarStyle()
.To fix this we override
ChildViewControllerForStatusBarStyle
on our internalChildViewController
and point to page's VC.Issues Resolved
API Changes
None
Platforms Affected
Behavioral/Visual Changes
Should be able to provide UIStatusBar color
Before/After Screenshots
Before:
After:
Testing Procedure
Start the ControlGallery and check if the UIStatus bar shows white content on the left, and black content on the right.
PR Checklist