phonegap-build / StatusBarPlugin

PhoneGap Build Plugin providing some customizations to the iOS status bar
https://build.phonegap.com/plugins/304
92 stars 46 forks source link

Not working with Phonegap Build? #26

Closed Papasmurfo closed 10 years ago

Papasmurfo commented 10 years ago

Is this not working with Phonegap build?

Currently trying to change my status bar colour, with the following code:

    <gap:plugin name="com.phonegap.plugin.statusbar" />
    <preference name="StatusBarBackgroundColor" value="#4e9fd5" />

Is there any specific order I should be putting these in or in certain places?

Thanks for the plugin! Any help is greatly appreciated,

Jonathan

wildabeast commented 10 years ago

The StatusBarBackgroundColor and StatusBarOverlaysWebView preference tags are not yet supported by PhoneGap Build (in the readme).

Try this instead:

function deviceReady() {
    StatusBar.backgroundColorByHexString("#4e9fd5");
}
document.addEventListener('deviceready', deviceReady, false);
Papasmurfo commented 10 years ago

Thanks will give it a try!

On Friday, March 21, 2014, Ryan Willoughby notifications@github.com wrote:

The StatusBarBackgroundColor and StatusBarOverlaysWebView preference tags are not yet supported by PhoneGap Build (in the readmehttps://github.com/phonegap-build/StatusBarPlugin#preferences ).

Try this instead:

function deviceReady() { StatusBar.backgroundColorByHexString("#4e9fd5"); } document.addEventListener('deviceready', deviceReady, false);

Reply to this email directly or view it on GitHubhttps://github.com/phonegap-build/StatusBarPlugin/issues/26#issuecomment-38312316 .

Papasmurfo commented 10 years ago

This code makes the background of the status bar 'black' with black text.

Is there any other code that could be a work around?

Thanks again for the help,

Jonathan

igos commented 10 years ago

When it will be supported by Phonegap build?

wildabeast commented 10 years ago

@Papasmurfo What are you trying to achieve? If you want black with white text, check the docs:

StatusBar.backgroundColorByHexString("#4e9fd5");
StatusBar.styleLightContent();
wildabeast commented 10 years ago

@Igos not entirely sure -- its on the backlog but not a priority, since you can easily work around it by setting these values via javascript instead.

Papasmurfo commented 10 years ago

Hi Ryan,

I tried the code that you supplied but the background colour doesn't work, but it does "kind" of work as it changes the background to black? With black text?

Any help is greatly appreciated,

Jonathan

On Friday, March 28, 2014, Ryan Willoughby notifications@github.com wrote:

@Papasmurfo https://github.com/Papasmurfo What are you trying to achieve? If you want black with white text, check the docshttps://github.com/phonegap-build/StatusBarPlugin/blob/master/README.md :

StatusBar.backgroundColorByHexString("#4e9fd5"); StatusBar.styleLightContent();

Reply to this email directly or view it on GitHubhttps://github.com/phonegap-build/StatusBarPlugin/issues/26#issuecomment-38964619 .

wildabeast commented 10 years ago

@Papasmurfo did you try:

StatusBar.styleLightContent();
Papasmurfo commented 10 years ago

Yes - copy and pasted the code you supplied before. I think it was wrapped in a function.

Thanks again,

Jonathan

On Friday, March 28, 2014, Ryan Willoughby notifications@github.com wrote:

@Papasmurfo https://github.com/Papasmurfo did you try StatusBar.styleLightContent();

Reply to this email directly or view it on GitHubhttps://github.com/phonegap-build/StatusBarPlugin/issues/26#issuecomment-38964927 .

wildabeast commented 10 years ago

Is this on PhoneGap Build? Can you share your App ID?

Papasmurfo commented 10 years ago

Yes, would you be able to supply your email so I can throw you the whole JS file and then we can post the resolution here.

Jonathan

On Friday, March 28, 2014, Ryan Willoughby notifications@github.com wrote:

Is this on PhoneGap Build? Can you share your App ID?

Reply to this email directly or view it on GitHubhttps://github.com/phonegap-build/StatusBarPlugin/issues/26#issuecomment-38965150 .

wildabeast commented 10 years ago

Please send it to build at phonegap.com

Papasmurfo commented 10 years ago

Ah - I'll just post the code here but essentially in my main.js file I have the following.

function deviceReady() { StatusBar.backgroundColorByHexString("#4e9fd5"); } document.addEventListener('deviceready', deviceReady, false);

This seems to create a black bar with black text for some reason.

On Friday, March 28, 2014, Ryan Willoughby notifications@github.com<javascript:_e(%7B%7D,'cvml','notifications@github.com');> wrote:

Please send it to build at phonegap.com

Reply to this email directly or view it on GitHubhttps://github.com/phonegap-build/StatusBarPlugin/issues/26#issuecomment-38965413 .

wildabeast commented 10 years ago

I can't really do much with that without seeing the context. Please send me your PhoneGap Build app ID to build at phonegap.com.

Papasmurfo commented 10 years ago

Will do Ryan. Thanks again for helping our with this one.

Best,

Jonathan

On Friday, March 28, 2014, Ryan Willoughby notifications@github.com wrote:

I can't really do much with that without seeing the context. Please send me your PhoneGap Build app ID to build at phonegap.com.

Reply to this email directly or view it on GitHubhttps://github.com/phonegap-build/StatusBarPlugin/issues/26#issuecomment-38966147 .

wildabeast commented 10 years ago

@Papasmurfo haven't heard from you, closing this issue. Let me know if I missed an email.

sfentress commented 10 years ago

@wildabeast I can replicate @Papasmurfo's bug on Phonegap build. Here's my build: https://build.phonegap.com/apps/951372/builds

I am trying to call StatusBar.backgroundColorByHexString("#FFFFFF"); but instead I get a black statusbar with black text.

As far as I can tell, StatusBar is never defined -- if I use Phonegap Build's debug view I get ReferenceError: Can't find variable: StatusBar

sfentress commented 10 years ago

I was able to fix this by switching to version 1.0.1 of the plugin. Using the earlier version, I can now access the StatusBar JS object, and set the background color to white.

omnoms commented 9 years ago

Yeah, I have the same issue. StatusBar is undefined in the global scope for javascript in the latest. Had to revert to 1.0.1