vs2015 ionic cordova ios模拟器中没有图标
Posted
技术标签:
【中文标题】vs2015 ionic cordova ios模拟器中没有图标【英文标题】:vs2015 ionic cordova no icons in ios simulator 【发布时间】:2016-02-20 15:25:44 【问题描述】:我在 vs2015 中创建了一个 ionic cordova 应用程序。该项目具有离子创建的图标和飞溅图像。这些在android上运行良好。当我在 ios 上构建和运行应用程序时,图标和启动画面仍然是科尔多瓦的默认设置。在platforms/ios 目录中,正确的图像位于images.xcassets 文件夹中。但没有被模拟器中的应用程序拾取。
任何人都遇到过这个问题。我已经尝试过删除和重建,清除缓存等config.xml代码如下:
<allow-navigation href="http://*/*" />
<allow-navigation href="*" />
<content src="index.html" />
<access origin="*" />
<preference name="webviewbounce" value="false" />
<preference name="UIWebViewBounce" value="false" />
<preference name="DisallowOverscroll" value="true" />
<preference name="android-minSdkVersion" value="16" />
<preference name="BackupWebStorage" value="none" />
<preference name="SplashScreen" value="screen" />
<preference name="SplashScreenDelay" value="3000" />
<preference name="KeepRunning" value="True" />
<preference name="ShowTitle" value="True" />
<preference name="InAppBrowserStorageEnabled" value="True" />
<preference name="SuppressesIncrementalRendering" value="True" />
<feature name="StatusBar">
<param name="ios-package" value="CDVStatusBar" onload="true" />
</feature>
<plugin name="cordova-plugin-console" version="1.0.2" />
<plugin name="cordova-plugin-device" version="1.1.1" />
<plugin name="cordova-plugin-statusbar" version="2.1.1" />
<plugin name="cordova-plugin-whitelist" version="1.2.1" />
<plugin name="ionic-plugin-keyboard" version="1.0.8" />
<plugin name="cordova-plugin-admobpro" version="2.11.1" src="https://github.com/floatinghotpot/cordova-admob-pro.git" />
<plugin name="cordova-plugin-extension" version="1.2.9" />
<plugin name="cordova-plugin-network-information" version="1.2.0" />
<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-land-ldpi-screen.png" density="land-ldpi" />
<splash src="resources\android\splash\drawable-land-mdpi-screen.png" density="land-mdpi" />
<splash src="resources\android\splash\drawable-land-hdpi-screen.png" density="land-hdpi" />
<splash src="resources\android\splash\drawable-land-xhdpi-screen.png" density="land-xhdpi" />
<splash src="resources\android\splash\drawable-land-xxhdpi-screen.png" density="land-xxhdpi" />
<splash src="resources\android\splash\drawable-land-xxxhdpi-screen.png" density="land-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" />
</platform>
<platform name="ios">
<icon src="resources\ios\icon\icon.png" />
<icon src="resources\ios\icon\icon@2x.png" />
<icon src="resources\ios\icon\icon-40.png" />
<icon src="resources\ios\icon\icon-40@2x.png" />
<icon src="resources\ios\icon\icon-50.png" />
<icon src="resources\ios\icon\icon-50@2x.png" />
<icon src="resources\ios\icon\icon-60.png" />
<icon src="resources\ios\icon\icon-60@2x.png" />
<icon src="resources\ios\icon\icon-60@3x.png" />
<icon src="resources\ios\icon\icon-72.png" />
<icon src="resources\ios\icon\icon-72@2x.png" />
<icon src="resources\ios\icon\icon-76.png" />
<icon src="resources\ios\icon\icon-76@2x.png" />
<icon src="resources\ios\icon\icon-small.png" />
<icon src="resources\ios\icon\icon-small@2x.png" />
<icon src="resources\ios\icon\icon-small@3x.png" />
<splash src="resources\ios\splash\Default-568h@2x~iphone.png" />
<splash src="resources\ios\splash\Default-667h.png" />
<splash src="resources\ios\splash\Default-736h.png" />
<splash src="resources\ios\splash\Default-Landscape-736h.png" />
<splash src="resources\ios\splash\Default-Landscape@2x~ipad.png" />
<splash src="resources\ios\splash\Default-Landscape~ipad.png" />
<splash src="resources\ios\splash\Default-Portrait@2x~ipad.png" />
<splash src="resources\ios\splash\Default-Portrait~ipad.png" />
<splash src="resources\ios\splash\Default@2x~iphone.png" />
<splash src="resources\ios\splash\Default~iphone.png" />
</platform>
<icon src="resources\android\icon\drawable-xhdpi-icon.png" />
<plugin name="cordova-plugin-splashscreen" version="3.2.1-dev" src="https://github.com/apache/cordova-plugin-splashscreen.git" />
<preference name="Orientation" value="portrait" />
</widget>
【问题讨论】:
【参考方案1】:当我从 VS2015 部署到远程设备到 mac 时,我遇到了同样的问题。 图标和启动画面是默认设置。
但是当:
我将“platforms/ios”文件夹从 windows 复制并粘贴到 Mac 我在 Mac 上使用 Xcode 将项目构建到连接的设备-> 图标和闪屏是不错的,并且可以很好地显示在部署的设备上。
而且当应用程序可以通过 tesflight 测试或发布时,图标和闪屏是正确的。
【讨论】:
【参考方案2】:刚刚在这里找到了答案:
Cordova ios icon (and splashscreen) not showing with Ionic resources
<splash src="resources\ios\splash\Default~iphone.png" />
斜线应该是
<splash src="resources/ios/splash/Default~iphone.png" />
【讨论】:
以上是关于vs2015 ionic cordova ios模拟器中没有图标的主要内容,如果未能解决你的问题,请参考以下文章
升级到 Ionic 1.3 后,Ionic/Cordova 联系人插件在 iOS 上返回 Invalid Date
Cordova + Ionic - 将标头混合到 iOS 标头中
在 ios 上使用 ionic/cordova 添加平台期间未安装的插件