Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

cant hide statusbar in ios using xcode phonegap

Im trying to remove the statusbar in my xcode iOS project. phonegap version 2.5. Ive tried the following.

1) removing statusbar from phonegap specific projects by adding the following line to config.xml

<preference name="fullscreen" value="true" />

this is my xml file.

    <?xml version="1.0" encoding="UTF-8"?>
    <widget>
    <preference name="KeyboardDisplayRequiresUserAction" value="true" />
    <preference name="SuppressesIncrementalRendering" value="false" />
    <preference name="UIWebViewBounce" value="false" />
    <preference name="TopActivityIndicator" value="gray" />
    <preference name="EnableLocation" value="false" />
    <preference name="EnableViewportScale" value="true" />
    <preference name="AutoHideSplashScreen" value="true" />
    <preference name="ShowSplashScreenSpinner" value="false" />
    <preference name="FadeSplashScreen" value="true" />
    <preference name="FadeSplashScreenDuration" value=".25" />
    <preference name="MediaPlaybackRequiresUserAction" value="false" />
    <preference name="AllowInlineMediaPlayback" value="false" />
    <preference name="BackupWebStorage" value="cloud" />
    <preference name="fullscreen" value="true" />

    <content src="index.html" />

    <plugins>
        <plugin name="Device" value="CDVDevice" />
        <plugin name="Logger" value="CDVLogger" />
        <plugin name="Compass" value="CDVLocation" />
        <plugin name="Accelerometer" value="CDVAccelerometer" />
        <plugin name="Camera" value="CDVCamera" />
        <plugin name="NetworkStatus" value="CDVConnection" />
        <plugin name="Contacts" value="CDVContacts" />
        <plugin name="Debug Console" value="CDVDebugConsole" />
        <plugin name="Echo" value="CDVEcho" />
        <plugin name="File" value="CDVFile" />
        <plugin name="FileTransfer" value="CDVFileTransfer" />
        <plugin name="Geolocation" value="CDVLocation" />
        <plugin name="Notification" value="CDVNotification" />
        <plugin name="Media" value="CDVSound" />
        <plugin name="Capture" value="CDVCapture" />
        <plugin name="SplashScreen" value="CDVSplashScreen" />
        <plugin name="Battery" value="CDVBattery" />
        <plugin name="Globalization" value="CDVGlobalization" />
        <plugin name="InAppBrowser" value="CDVInAppBrowser" />
    </plugins>

    <access origin="*" />
</widget>

test

ive also have this added to my plist file. This should remove statusbar for specific ios apps.

<key>[UIApplication sharedApplication].statusBarHidden = YES;</key>

code:

<?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>CFBundleIcons</key>
    <dict>
        <key>CFBundlePrimaryIcon</key>
        <dict>
            <key>CFBundleIconFiles</key>
            <array>
                <string>icon.png</string>
                <string>[email protected]</string>
                <string>icon-72.png</string>
                <string>[email protected]</string>
            </array>
            <key>UIPrerenderedIcon</key>
            <false/>
        </dict>
    </dict>
    <key>UISupportedInterfaceOrientations~ipad</key>
    <array>
        <string>UIInterfaceOrientationPortrait</string>
        <string>UIInterfaceOrientationLandscapeLeft</string>
        <string>UIInterfaceOrientationPortraitUpsideDown</string>
        <string>UIInterfaceOrientationLandscapeRight</string>
    </array>
    <key>UISupportedInterfaceOrientations</key>
    <array>
        <string>UIInterfaceOrientationPortrait</string>
    </array>
    <key>CFBundleDevelopmentRegion</key>
    <string>English</string>
    <key>CFBundleDisplayName</key>
    <string>${PRODUCT_NAME}</string>
    <key>CFBundleExecutable</key>
    <string>${EXECUTABLE_NAME}</string>
    <key>CFBundleIconFile</key>
    <string>icon.png</string>
    <key>CFBundleIdentifier</key>
    <string>org.apache.cordova.HelloWorld</string>
    <key>CFBundleInfoDictionaryVersion</key>
    <string>6.0</string>
    <key>CFBundleName</key>
    <string>${PRODUCT_NAME}</string>
    <key>CFBundlePackageType</key>
    <string>APPL</string>
    <key>CFBundleSignature</key>
    <string>????</string>
    <key>CFBundleVersion</key>
    <string>1.0</string>
    <key>LSRequiresIPhoneOS</key>
    <true/>
    <key>NSMainNibFile</key>
    <string></string>
    <key>[UIApplication sharedApplication].statusBarHidden = YES;</key>
    <string>YES</string>
    <key>NSMainNibFile~ipad</key>
    <string></string>
</dict>
</plist>

Why is none of this working??

like image 918
aZtraL-EnForceR Avatar asked Mar 20 '13 11:03

aZtraL-EnForceR


2 Answers

OP is 99% correct, but you you only need to tick the box "Hide during application launch"

This is where you find it:

Select Project Navigator (folder icon in the sidebar)

Select the root project (the one with your project name)

Then in the main menu, highlight the Summary tab, scroll down to "Status bar"

like image 135
Design by Adrian Avatar answered Sep 20 '22 06:09

Design by Adrian


i fixed this finally..! I went into project properties by clicking on the project. under target / yourProject there was a statusbar menu. i selected statusbar: black translucent which fixed it.

like image 27
aZtraL-EnForceR Avatar answered Sep 21 '22 06:09

aZtraL-EnForceR