Ich versuche, die Statusleiste in meinem xcode iOS-Projekt zu entfernen. Phonegap Version 2.5. Ich habe folgendes versucht.kann Statusleiste in ios mit xcode phonegap nicht verstecken
1) Statusbar von phonegap spezifischen Projekten zu entfernen, indem Sie die folgende Zeile hinzufügen
<preference name="fullscreen" value="true" />
das ist meine XML-Datei config.xml.
<?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 auch haben diese hinzugefügt, um meine plist-Datei. Dadurch sollte die Statusleiste für bestimmte iOS-Apps entfernt werden.
<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>
Warum ist keiner dieser Arbeits ??
Versuchen Sie Folgendes: http://stackoverflow.com/a/20152984/1856577 Getestet mit Phonegap 1.9. – zilongqiu