Bug 19872 - SetStatusBarStyle(UIStatusBarStyle.LightContent) not working.
Summary: SetStatusBarStyle(UIStatusBarStyle.LightContent) not working.
Status: RESOLVED NOT_REPRODUCIBLE
Alias: None
Product: iOS
Classification: Xamarin
Component: Xamarin.iOS.dll ()
Version: 7.2.2
Hardware: PC Windows
: Normal normal
Target Milestone: Untriaged
Assignee: Bugzilla
URL:
Depends on:
Blocks:
 
Reported: 2014-05-17 19:43 UTC by curtis.harrison@wavetronix.com
Modified: 2016-01-06 02:47 UTC (History)
5 users (show)

Tags:
Is this bug a regression?: ---
Last known good build:


Attachments
Screenshot of Visual Studio Status Bar Style Options (97.95 KB, image/png)
2014-05-19 11:44 UTC, curtis.harrison@wavetronix.com
Details
screenshot (66.04 KB, image/png)
2014-05-25 11:03 UTC, Sebastien Pouliot
Details


Notice (2018-05-24): bugzilla.xamarin.com is now in read-only mode.

Please join us on Visual Studio Developer Community and in the Xamarin and Mono organizations on GitHub to continue tracking issues. Bugzilla will remain available for reference in read-only mode. We will continue to work on open Bugzilla bugs, copy them to the new locations as needed for follow-up, and add the new items under Related Links.

Our sincere thanks to everyone who has contributed on this bug tracker over the years. Thanks also for your understanding as we make these adjustments and improvements for the future.


Please create a new report on Developer Community or GitHub with your current version information, steps to reproduce, and relevant error messages or log files if you are hitting an issue that looks similar to this resolved bug and you do not yet see a matching new report.

Related Links:
Status:
RESOLVED NOT_REPRODUCIBLE

Description curtis.harrison@wavetronix.com 2014-05-17 19:43:24 UTC
Description of Problem:

SetStatusBarStyle(UIStatusBarStyle.LightContent, true) doesn't work.  Nothing happens when it is called no matter where I call it from.


Steps to reproduce the problem:
I call app.SetStatusBarStyle(UIStatusBarStyle.LightContent, true) and it makes no effect.  My statusbar text is still black all the time.  I call this at the end of my AppDelegate.FinishedLaunching() method.  I called it in various other places in my code using UIApplication.SharedApplication.SetStatusBarStyle(UIStatusBarStyle.LightContent, true) and no affect.

I also tried changing the Info.plist directly.


Actual Results:
No change occurs in the color of the Status Bar Text at the top of the screen

Expected Results:
Status Bar Text should change to WHITE.


How often does this happen? 
Anytime I try it.

Additional Information:
SetStatusBarHidden(true, true) doesn't do anything either.
Comment 1 Sadik Ali 2014-05-19 06:23:34 UTC
I have checked this issue and observed the same behavior mentioned in bug description. To reproduce this issue I have followed the steps mentioned in bug description.

Screencast : http://screencast.com/t/syExnNW8B

Environment Info : 

=== Xamarin Studio ===

Version 4.2.5 (build 0)
Installation UUID: 011d70a5-dede-428b-ab04-ef451c2e539d
Runtime:
	Mono 3.4.0 ((no/51469e6)
	GTK+ 2.24.23 (Raleigh theme)

	Package version: 304000202

=== Apple Developer Tools ===

Xcode 5.1 (5084)
Build 5B130a

=== Xamarin.iOS ===

Version: 7.2.2.2 (Business Edition)
Hash: db4427f
Branch: 
Build date: 2014-04-22 12:49:14-0400

=== Xamarin.Android ===

Version: 4.12.3 (Business Edition)
Android SDK: /Users/MM/Desktop/android-sdk-macosx
	Supported Android versions:
		2.1   (API level 7)
		2.2   (API level 8)
		2.3   (API level 10)
		3.1   (API level 12)
		3.2   (API level 13)
		4.0   (API level 14)
		4.0.3 (API level 15)
		4.1   (API level 16)
		4.2   (API level 17)
		4.3   (API level 18)
		4.4   (API level 19)
Java SDK: /usr
java version "1.6.0_65"
Java(TM) SE Runtime Environment (build 1.6.0_65-b14-462-11M4609)
Java HotSpot(TM) 64-Bit Server VM (build 20.65-b04-462, mixed mode)

=== Xamarin.Mac ===

Xamarin.Mac: Not Installed

=== Build Information ===

Release ID: 402050000
Git revision: 95ac543f224a70960a9ab71e24ce341eb87de06f
Build date: 2014-05-02 13:05:15-04
Xamarin addins: b81285ac0156281956135adb96685f98922893a1

=== Operating System ===

Mac OS X 10.9.2
Darwin MacMini.local 13.1.0 Darwin Kernel Version 13.1.0
    Thu Jan 16 19:40:37 PST 2014
    root:xnu-2422.90.20~2/RELEASE_X86_64 x86_64


Note : I have checked this issue with device iPhone 5C iOS 7.1 and observed the same behavior.
Comment 2 Sebastien Pouliot 2014-05-19 10:32:34 UTC
Without a test case it's hard to guess what exactly you are looking for. E.g. Are you looking for a global change for your application ? or for a specific view controller change ?

If you want the default/global app then you'll need to tell the application to ignore the view controller values, e.g. see http://stackoverflow.com/a/20415916
Comment 3 curtis.harrison@wavetronix.com 2014-05-19 11:43:57 UTC
My app has a BLACK background.  I am trying to make the main status bar that is on the top of the screen that shows the clock, battery, and wireless status have text that is WHITE, not BLACK, so that the user can see it.  Simple as that.  I have tried setting the value in the Info.plist:

	<key>UIStatusBarTintParameters</key>
	<dict>
		<key>UINavigationBar</key>
		<dict>
			<key>Style</key>
			<string>UIBarStyleLightContent</string>
			<key>Translucent</key>
			<false/>
		</dict>
	</dict>

I have tried setting the value in the properties page for the project, but there is no 'white' text value to set (see attachment)

I have attempted programatically in many places in my code to set the text to light colored:  

UIApplication.SharedApplication.SetStatusBarStyle(UIStatusBarStyle.LightContent,
true)

Nothing seems to work.  As a workaround, I placed a light gray window at the top of my main view so that the BLACK text of the status bar will show up.

I am targeting iOS 6.1 for my app so that it will work on iPod 4th generations and newer devices.

If this is NOT a bug, please tell me how I can get the text to appear WHITE instead of BLACK, or 'Light' colored to be consistent with the iOS documentation.
Comment 4 curtis.harrison@wavetronix.com 2014-05-19 11:44:47 UTC
Created attachment 6837 [details]
Screenshot of Visual Studio Status Bar Style Options
Comment 5 Sebastien Pouliot 2014-05-25 11:03:34 UTC
Created attachment 6876 [details]
screenshot

Entry to add to your Info.plist (based on linke to SO in comment #3).
Comment 6 Sebastien Pouliot 2014-05-25 11:04:54 UTC
Typo, that was comment  #2