2016-04-20 24 views
4

Ich weiß, es gab eine Reihe von Posts darüber, aber keiner von ihnen funktioniert. Meine Android-Plattform funktioniert perfekt und zeigt das App-Symbol und den Begrüßungsbildschirm, aber die ios-Plattform weigert sich, sie anzuzeigen. Ich habe eine Reihe von verschiedenen Ordnerpositionen ausprobiert, und ich habe ionic resources verwendet, um die Bilddateien automatisch zu generieren und sie in die richtigen Ordner zu legen und die Datei config.xml zu füllen, die funktionieren sollte. Ich weiß nicht einmal, woher die App das Cordova-Roboterbild bekommt, ich kann es nirgendwo finden. Ich habe cordova platform rm ios && cordova platform add ios und ionic platform rm ios && ionic platform add ios ausgeführt, aber ohne Erfolg. Ich verwende Cordova 6.1.1 mit Ionic.Cordova ios Symbol (und Splashscreen) nicht mit Ionic Ressourcen

Dies ist das, was automatisch generiert in config.xml:

<icon src="resources\android\icon\drawable-xhdpi-icon.png"/> 
    <platform name="ios"> 
    <preference name="KeyboardDisplayRequiresUserAction" value="false"/> 
    <icon src="resources\ios\icon\icon.png" width="57" height="57"/> 
    <icon src="resources\ios\icon\[email protected]" width="114" height="114"/> 
    <icon src="resources\ios\icon\icon-40.png" width="40" height="40"/> 
    <icon src="resources\ios\icon\[email protected]" width="80" height="80"/> 
    <icon src="resources\ios\icon\icon-50.png" width="50" height="50"/> 
    <icon src="resources\ios\icon\[email protected]" width="100" height="100"/> 
    <icon src="resources\ios\icon\icon-60.png" width="60" height="60"/> 
    <icon src="resources\ios\icon\[email protected]" width="120" height="120"/> 
    <icon src="resources\ios\icon\[email protected]" width="180" height="180"/> 
    <icon src="resources\ios\icon\icon-72.png" width="72" height="72"/> 
    <icon src="resources\ios\icon\[email protected]" width="144" height="144"/> 
    <icon src="resources\ios\icon\icon-76.png" width="76" height="76"/> 
    <icon src="resources\ios\icon\[email protected]" width="152" height="152"/> 
    <icon src="resources\ios\icon\icon-small.png" width="29" height="29"/> 
    <icon src="resources\ios\icon\[email protected]" width="58" height="58"/> 
    <icon src="resources\ios\icon\[email protected]" width="87" height="87"/> 
    <splash src="resources\ios\splash\[email protected]~iphone.png" width="640" height="1136"/> 
    <splash src="resources\ios\splash\Default-667h.png" width="750" height="1334"/> 
    <splash src="resources\ios\splash\Default-736h.png" width="1242" height="2208"/> 
    <splash src="resources\ios\splash\[email protected]~ipad.png" width="1536" height="2048"/> 
    <splash src="resources\ios\splash\Default-Portrait~ipad.png" width="768" height="1024"/> 
    <splash src="resources\ios\splash\[email protected]~iphone.png" width="640" height="960"/> 
    <splash src="resources\ios\splash\Default~iphone.png" width="320" height="480"/> 
    </platform> 
    <platform name="android"> 
    <icon src="resources\android\icon\drawable-ldpi-icon.png" density="ldpi"/> 
    <icon src="resources\android\icon\drawable-mdpi-icon.png" density="mdpi"/> 
    <icon src="resources\android\icon\drawable-hdpi-icon.png" density="hdpi"/> 
    <icon src="resources\android\icon\drawable-xhdpi-icon.png" density="xhdpi"/> 
    <icon src="resources\android\icon\drawable-xxhdpi-icon.png" density="xxhdpi"/> 
    <icon src="resources\android\icon\drawable-xxxhdpi-icon.png" density="xxxhdpi"/> 
    <splash src="resources\android\splash\drawable-port-ldpi-screen.png" density="port-ldpi"/> 
    <splash src="resources\android\splash\drawable-port-mdpi-screen.png" density="port-mdpi"/> 
    <splash src="resources\android\splash\drawable-port-hdpi-screen.png" density="port-hdpi"/> 
    </platform> 

Warum sollte diese Arbeit auf Android und nicht ios? Jeder scheint eine Antwort auf ihr Problem zu finden, aber es scheint keine universelle Antwort zu geben. Ich brauche es sehr bald und ich kann es nicht ohne das richtige App-Icon starten. Kann jemand irgendwelche Vorschläge geben?

+0

Können Sie die Dateistruktur (Projektstruktur) für iOS, In Android-Pfad wird relativ und in iOS-Pfad wird absolut. Also, wenn Sie den Pfad wie Android geben, funktioniert es nicht in iOS. – NGB

+0

So, wie Struktur geht, ist der 'Ressourcen'-Ordner auf der obersten Ebene des Projekts. Ich weiß also nicht, ob es einen Unterschied machen wird, weil sie beide vom selben Level (egal ob absolut oder relativ) herunterkommen werden. Würde ich das richtig annehmen? – AndrewK

+1

Ressourcen-Datei ist neben der config.xml? entsprechend Ihrem Pfad in config.xml. Und Hauptsache '/' 'Diese Symbole sind wichtig – NGB

Antwort

7

Nauveen den Fehler gefunden. Wenn Sie Visual Studio in Windows verwenden und es auf einem Remote-Server auf einem Mac kompilieren, verwendet Windows umgekehrte Schrägstriche anstelle von Schrägstrichen. Dies ist für Android korrekt, aber iOS muss die Backslashes in Vorwärtsstriche umwandeln, um den richtigen Pfad zu den Bildern zu finden. Hier ist, wie die automatisch generierten Dateien in Ihrer config.xml-Datei aussehen sollen, wenn Sie Android in Windows und iOS auf einem entfernten Mac kompilieren:

<icon src="resources\android\icon\drawable-xhdpi-icon.png"/> 
    <platform name="ios"> 
    <preference name="KeyboardDisplayRequiresUserAction" value="false"/> 
    <icon src="resources/ios/icon/icon.png" width="57" height="57"/> 
    <icon src="resources/ios/icon/[email protected]" width="114" height="114"/> 
    <icon src="resources/ios/icon/icon-40.png" width="40" height="40"/> 
    <icon src="resources/ios/icon/[email protected]" width="80" height="80"/> 
    <icon src="resources/ios/icon/icon-50.png" width="50" height="50"/> 
    <icon src="resources/ios/icon/[email protected]" width="100" height="100"/> 
    <icon src="resources/ios/icon/icon-60.png" width="60" height="60"/> 
    <icon src="resources/ios/icon/[email protected]" width="120" height="120"/> 
    <icon src="resources/ios/icon/[email protected]" width="180" height="180"/> 
    <icon src="resources/ios/icon/icon-72.png" width="72" height="72"/> 
    <icon src="resources/ios/icon/[email protected]" width="144" height="144"/> 
    <icon src="resources/ios/icon/icon-76.png" width="76" height="76"/> 
    <icon src="resources/ios/icon/[email protected]" width="152" height="152"/> 
    <icon src="resources/ios/icon/icon-small.png" width="29" height="29"/> 
    <icon src="resources/ios/icon/[email protected]" width="58" height="58"/> 
    <icon src="resources/ios/icon/[email protected]" width="87" height="87"/> 
    <splash src="resources/ios/splash/[email protected]~iphone.png" width="640" height="1136"/> 
    <splash src="resources/ios/splash/Default-667h.png" width="750" height="1334"/> 
    <splash src="resources/ios/splash/Default-736h.png" width="1242" height="2208"/> 
    <splash src="resources/ios/splash/[email protected]~ipad.png" width="1536" height="2048"/> 
    <splash src="resources/ios/splash/Default-Portrait~ipad.png" width="768" height="1024"/> 
    <splash src="resources/ios/splash/[email protected]~iphone.png" width="640" height="960"/> 
    <splash src="resources/ios/splash/Default~iphone.png" width="320" height="480"/> 
    </platform> 
    <platform name="android"> 
    <icon src="resources\android\icon\drawable-ldpi-icon.png" density="ldpi"/> 
    <icon src="resources\android\icon\drawable-mdpi-icon.png" density="mdpi"/> 
    <icon src="resources\android\icon\drawable-hdpi-icon.png" density="hdpi"/> 
    <icon src="resources\android\icon\drawable-xhdpi-icon.png" density="xhdpi"/> 
    <icon src="resources\android\icon\drawable-xxhdpi-icon.png" density="xxhdpi"/> 
    <icon src="resources\android\icon\drawable-xxxhdpi-icon.png" density="xxxhdpi"/> 
    <splash src="resources\android\splash\drawable-port-ldpi-screen.png" density="port-ldpi"/> 
    <splash src="resources\android\splash\drawable-port-mdpi-screen.png" density="port-mdpi"/> 
    <splash src="resources\android\splash\drawable-port-hdpi-screen.png" density="port-hdpi"/> 
    <splash src="resources\android\splash\drawable-port-xhdpi-screen.png" density="port-xhdpi"/> 
    <splash src="resources\android\splash\drawable-port-xxhdpi-screen.png" density="port-xxhdpi"/> 
    <splash src="resources\android\splash\drawable-port-xxxhdpi-screen.png" density="port-xxxhdpi"/> 
+0

Sie müssen "ionic resources" -Befehl trotzdem ausführen, wenn Ihre Entwicklung von Mac zu Windows wechselt oder umgekehrt. – MobileEvangelist

+0

Toller Fund! Sparte mir viel Zeit. –

2

Versuchen Sie dieses Plugin

cordova-plugin-splashscreen 

Lauf cordova Plugin hinzufügen cordova-plugin-Begrüßungsbildschirm

Dann Installation innerhalb ypur config.xml diese Zeilen hinzufügen (nicht innerhalb Plattform iOS- oder Android-eher mit anderen Präferenzen).

<preference name="SplashScreenDelay" value="30000"/> 
    <preference name="AutoHideSplashScreen" value="true"/> 
    <preference name="FadeSplashScreen" value="false"/> 
    <preference name="ShowSplashScreenSpinner" value="false"/> 

Dann in Ihrer app.run Funktion in ionischer Plattform hinzufügen bereit diese Linien

if(navigator && navigator.splashscreen) navigator.splashscreen.hide(); 
0

prüft dies:

Das Mindestsymbol Bild Abmessungen sollten 192x192 px sein.

Die Mindestgröße des Splash-Bildes sollte 2208x2208 px betragen.

Wenn kleiner als die Mindestabmessungen, funktioniert ionic resources nicht.

Verwandte Themen