Alright so, I’ve read both http://learn.ionicframework.com/formulas/splash-screen/ and http://learn.ionicframework.com/formulas/customizing-the-status-bar/ but neither seem to be accurate (not sure how old they are, no dates on em, but that’d be a nice addition since things come and go so quickly) and I can’t get control over my splash or status bar. I’ve done the following to attempt getting these working:
ionic plugin add org.apache.cordova.statusbar
and ionic plugin add org.apache.cordova.splashscreen
after this, I usually just do ionic platform remove ios
and ionic platform add ios
since for whatever reason new plugins make a ionic build ios
fail after being installed unless you add/remove the platform.
now in my app.js
file, I invoke ngCordova
, a la:
var app = angular.module('myApp', ['ngCordova', 'ionic', 'myApp.controllers', 'myApp.services', 'myApp.directives'])
my app.run
:
.run(function($ionicPlatform) {
$ionicPlatform.ready(function() {
// Hide the accessory bar by default (remove this to show the accessory bar above the keyboard
// for form inputs)
if(window.cordova && window.cordova.plugins.Keyboard) {
cordova.plugins.Keyboard.hideKeyboardAccessoryBar(true);
cordova.plugins.Keyboard.disableScroll(true);
}
if(window.StatusBar) {
// org.apache.cordova.statusbar required
StatusBar.styleDefault();
}
});
})
my config.xml:
<preference name="SplashScreenDelay" value="3000" />
<!-- false = testing, keeps splash on -->
<preference name="AutoHideSplashScreen" value="false" />
<feature name="StatusBar">
<param name="ios-package" value="CDVStatusBar" onload="true"/>
</feature>
<platform name="ios">
<splash src="splash/ios/Default~iphone.png" width="320" height="480"/>
<splash src="splash/ios/Default@2x~iphone.png" width="640" height="960"/>
<splash src="splash/ios/Default-Portrait~ipad.png" width="768" height="1024"/>
<splash src="splash/ios/Default-Portrait@2x~ipad.png" width="1536" height="2048"/>
<splash src="splash/ios/Default-Landscape~ipad.png" width="1024" height="768"/>
<splash src="splash/ios/Default-Landscape@2x~ipad.png" width="2048" height="1536"/>
<splash src="splash/ios/Default-568h@2x~iphone.png" width="640" height="1136"/>
</platform>
Note above, I don’t use the directory suggested in http://learn.ionicframework.com/formulas/splash-screen/, does it really matter?
Alternatively, when trying to get status bar working I change my app.run
to:
.run(function($ionicPlatform,$cordovaStatusbar) {
$ionicPlatform.ready(function() {
$cordovaStatusbar.overlaysWebView(true);
$cordovaStatusbar.styleColor('white');
// Hide the accessory bar by default (remove this to show the accessory bar above the keyboard
// for form inputs)
if(window.cordova && window.cordova.plugins.Keyboard) {
cordova.plugins.Keyboard.hideKeyboardAccessoryBar(true);
cordova.plugins.Keyboard.disableScroll(true);
}
});
})
this works sometimes, really no idea what makes it break or work, but it seems that half the time it does(?)
Has anyone else gotten both to work on iOS 8?