plistinject not working

107 views
Skip to first unread message

Michael Kroll

unread,
Aug 11, 2014, 5:51:25 AM8/11/14
to codenameone...@googlegroups.com
Hi!

I'm working on an iOS Application and want to change the textcolor to white.
After some searching I think the solution would be to set ios.plistInject to <key>UIViewControllerBasedStatusBarAppearance</key><false/><key>UIStatusBarStyle</key> <string>UIStatusBarStyleLightContent</string>.
Some users here in the forum seem to have used this with success, but it does nothing for me (Text is still black).
Is there something I'm missing? I tried some other plist injections in the past, didn't work either.

The generated /build/xcode/sys/MyApplication-Info.plist looks like this:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>UIStatusBarHidden</key>
<false/>
<key>UIPrerenderedIcon</key>
<false/>
<key>UIFileSharingEnabled</key>
<false/>
<key>UIApplicationExitsOnSuspend</key>
<false/>
<key>CFBundleDevelopmentRegion</key>
<string>English</string>
<key>CFBundleIconFiles</key>
<array>
<string>Icon.png</string>
<string>Ic...@2x.png</string>
<string>Icon-72.png</string>
<string>Icon-Small-50.png</string>
<string>Icon-Small.png</string>
<string>Icon-...@2x.png</string>
<string>Icon7.png</string>
<string>Ic...@2x.png</string>
<string>Icon-76.png</string>
<string>Icon-152.png</string>
</array>
<key>CFBundleDisplayName</key>
<string>Hasetal</string>
<key>CFBundleExecutable</key>
<string>MyApplication</string>
<key>CFBundleIdentifier</key>
<string>com.thammit.hasetal</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundleName</key>
<string>MyApplication</string>
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
<string>1.22</string>
<key>LSRequiresIPhoneOS</key>
<true/>
<key>NSMainNibFile</key>
<string>MainWindow</string>
<key>UIInterfaceOrientation</key>
<string>UIInterfaceOrientationPortrait</string>
<key>UISupportedInterfaceOrientations</key>
<array>
<string>UIInterfaceOrientationPortrait</string>
<string>UIInterfaceOrientationPortraitUpsideDown</string>
</array>

<key>UIViewControllerBasedStatusBarAppearance</key><false/><key>UIStatusBarStyle</key> <string>UIStatusBarStyleLightContent</string></dict>
</plist>

So it should work, right?

I'm testing this on an iPad2 running iOS 7.1.2

Shai Almog

unread,
Aug 11, 2014, 10:53:36 AM8/11/14
to codenameone...@googlegroups.com
Hi,
we have a build argument specifically for that:
ios.statusBarFG=UIStatusBarStyleLightContent

It should work.

Michael Kroll

unread,
Aug 11, 2014, 5:43:32 PM8/11/14
to codenameone...@googlegroups.com
Nice, thanks!

I noticed there are some other very useful build args floating around the forum, which I could not find anywhere in the documentation or on the build args page. It would be really awesome if you guys could update them.

Shai Almog

unread,
Aug 12, 2014, 12:30:59 AM8/12/14
to codenameone...@googlegroups.com
Yes we should refresh the documents for the next release.

Michael Kroll

unread,
Aug 12, 2014, 4:51:20 AM8/12/14
to codenameone...@googlegroups.com

I tried the argument but my statusbar text is still black.
Is there anything else I could try?


On Monday, August 11, 2014 4:53:36 PM UTC+2, Shai Almog wrote:

Shai Almog

unread,
Aug 12, 2014, 9:47:54 AM8/12/14
to codenameone...@googlegroups.com
Why did you set UIViewControllerBasedStatusBarAppearance to false?
Shouldn't it be YES?

Michael Kroll

unread,
Aug 12, 2014, 10:53:37 AM8/12/14
to codenameone...@googlegroups.com
It's what I found on the internet and this forum.
Also it's what gets written into the plist when I use the ios.statusBarFG flag.

Shai Almog

unread,
Aug 13, 2014, 1:21:16 AM8/13/14
to codenameone...@googlegroups.com
Are you using the new VM or the old VM?

Michael Kroll

unread,
Aug 13, 2014, 4:09:36 AM8/13/14
to codenameone...@googlegroups.com
I think I'm using the old one, if that is the default.

I tested it with ios.newVM = true and the bar is still black, also my App wouldn't really work right.
I test for a connection the the content server on launch and it failed somehow.

I will try to build a complete blank project to see if I messed up somewhere, even though I don't know how or where.

Michael Kroll

unread,
Aug 13, 2014, 4:48:30 AM8/13/14
to codenameone...@googlegroups.com
Ok I think I found the problem.
The build argument works fine (and I would guess the inject too) if you are doing a normal ios build.
However since my App is designed for phones, I'm using the iphone project option so iPad users get that scaled version of the app.
Thats when the statusbar gets black.

I read somewhere that <key>UIStatusBarStyle</key><string>UIStatusBarStyleLightContent</string> won't work if you are missing one of the splash images. I'm guessing this is the case here since everytime I start the app I get the fullscreen version for a split second and then It scales down. I guess the aren't any iphone-on-ipad splash screens generated on the build server. Is there a way to provide them myself?

Shai Almog

unread,
Aug 13, 2014, 10:44:29 AM8/13/14
to codenameone...@googlegroups.com
Actually that's not something that should happen, its probably something we should fix since we always generate all 7 screenshots.
You can override a specific screenshot but currently you can't prevent its generation so that shouldn't be the reason.
http://www.codenameone.com/blog/screenshots-and-graphics-update

Michael Kroll

unread,
Aug 14, 2014, 10:15:21 AM8/14/14
to codenameone...@googlegroups.com
I checked and the right launch image should be the default@2x one, which of course gets generated.
Somehow the App starts in the wrong resolution.
So what could be the reason?

Shai Almog

unread,
Aug 14, 2014, 1:16:39 PM8/14/14
to codenameone...@googlegroups.com
I'm guessing this might be related to some elaborate code we have that shows the splash screen before loading the actual VM. This prevents a flicker between the native splash and the VM startup.
I'm not sure what the right workaround for this should be.

Michael Kroll

unread,
Aug 15, 2014, 3:59:28 AM8/15/14
to codenameone...@googlegroups.com
Well, how about just changing the color in code?
I found this solution on StackOverflow:
[application setStatusBarHidden:NO];
[application setStatusBarStyle:UIStatusBarStyleLightContent];

I have no clue about Objective-C, I guess "application" is something like the app context on Android.
Would it be possible to do this in a native interface?

Shai Almog

unread,
Aug 15, 2014, 10:54:10 AM8/15/14
to codenameone...@googlegroups.com
Yes, it should be pretty easy to do this using a native interface.
Reply all
Reply to author
Forward
0 new messages