1)通过将以下行添加到config.xml来从phonegap特定项目中删除状态栏
<preference name="fullscreen" value="true" />
这是我的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>
测试
香港专业教育学院也有这个添加到我的pList文件.这应删除特定ios应用的状态栏.
<key>[UIApplication sharedApplication].statusbarHIDden = YES;</key>
码:
<?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>icon@2x.png</string> <string>icon-72.png</string> <string>icon-72@2x.png</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>
为什么没有这个工作?
解决方法 OP是99%正确,但您只需勾选“在应用程序启动期间隐藏”框这是你找到它的地方:
选择Project Navigator(侧栏中的文件夹图标)
选择根项目(具有项目名称的项目)
然后在主菜单中,突出显示摘要选项卡,向下滚动到“状态栏”
总结以上是内存溢出为你收集整理的使用xcode phonegap无法在ios中隐藏状态栏全部内容,希望文章能够帮你解决使用xcode phonegap无法在ios中隐藏状态栏所遇到的程序开发问题。
如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)