Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[iOS] Redirect PreferredStatusBarStyle to the Child View Controller #1175

Merged
merged 1 commit into from Dec 22, 2017

Conversation

@MarkoBL
Copy link
Contributor

MarkoBL commented Sep 29, 2017

Description of Change

UIApplication.StatusBarStyle is deprecated since iOS 9 (https://developer.apple.com/documentation/uikit/uiapplication/1622988-statusbarstyle) and doesn't work on Xamarin.Forms at all. If you use the black navigation bar style or a dark background color for the navigation page, the status bar always uses the default black color.

This PR simply redirects the calls to UIViewController.PreferredStatusBarStyle from the PlatformRenderer to the top view controller (NavigationRenderer or PageRenderer), therefore you can set the status bar color in your own renderer/ViewController:

	public class ExtNavigationRenderer : NavigationRenderer
	{
		public override UIStatusBarStyle PreferredStatusBarStyle()
		{
			return UIStatusBarStyle.LightContent;
		}
	}

Behavioral Changes

There should be none.

PR Checklist

  • Has tests (if omitted, state reason in description)
  • Rebased on top of master at time of PR
  • Changes adhere to coding standard
  • Consolidate commits as makes sense
@adrianknight89

This comment has been minimized.

Copy link
Contributor

adrianknight89 commented Oct 28, 2017

@pauldipietro Wasn't this fixed a couple months back or there was a platform specific option dealing with this? I can't remember, but I remember some kind of working being done with regards to PreferredStatusBarStyle vs child view controllers.

@pauldipietro

This comment has been minimized.

Copy link
Member

pauldipietro commented Dec 12, 2017

@adrianknight89 #463 was the PR having to do with PrefersStatusBarHidden which I believe you're referring to.

@rmarinho rmarinho merged commit 62729d5 into xamarin:master Dec 22, 2017
10 of 13 checks passed
10 of 13 checks passed
VSTS: iOS10 Validation UITests Finished
Details
VSTS: iOS11 Validation UITests Finished
Details
VSTS: iOS9 Validation UITests Finished
Details
VSTS: Android API19 Validation Fast Renderers UITests Finished
Details
VSTS: Android API19 Validation Legacy Renderers UITests Finished
Details
VSTS: Android API23 Validation Fast Renderers UITests Finished
Details
VSTS: Android API23 Validation Legacy Renderers UITests Finished
Details
VSTS: Android API25 Validation Fast Renderers UITests Finished
Details
VSTS: Android API25 Validation Legacy Renderers UITests Finished
Details
VSTS: Xamarin Forms (PR Builds) Started PR process
Details
VSTS: Xamarin Forms OSX pull-1175 - (1216683) succeeded
Details
VSTS: Xamarin Forms Windows VS2017 PR-1175 - (1216683) succeeded
Details
license/cla All CLA requirements met.
Details
@samhouts samhouts added this to the 3.0.0 milestone May 5, 2018
@samhouts samhouts modified the milestones: 3.0.0, 2.5.0 Aug 23, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
7 participants
You can’t perform that action at this time.