项目总结2:ionic3开发跨平台App如何设置和替换应用图标及启动图

       前言: 和原生开发一样,ionic官方提供的设置方式也很简单,只不过多了一个步骤:基于ionic命令的方式自动修改全局的配置文件config.xml。

设置或替换应用图标和应用启动图:

  1. 把UI提供的图标拿过来改成特定的名称"icon.png"(不一定是png格式的,可以为png、psd、ai格式,但名称不变);
  2. 将"icon.png"拖拽到项目更目录下面的"resources"文件夹中;
  3. 在Terminal控制台中执行如下命令(必须在联网环境中):

          3.1  方式一,直接运行:ionic resources

                执行该命令后,会自动在resources文件夹下创建已添加的平台名称的文件夹,自动将图片进行缩放、裁剪,生成不同分             辨率的图片,并在config.xml中更新相应的配置信息。

          3.2  方式二,也可以分开执行:  

                 修改图标:    ionic resources --icon     
                 修改启动图:ionic resources --splash

                 resources文件夹目录结构为: 

resources目录示意图

注意事项:

  • 需要在联网环境中执行命令;
  • 如果图片没成功生成则执行清除缓存的命令再重试一遍:ionic resources --clean-cache

成功执行完命令后ionic会修改config.xml配置文件中应用图标和启动图的配置,如:

<platform name="android"><allow-intent href="market:*" /><config-file parent="/*" target="AndroidManifest.xml"><uses-permission android:name="android.permission.REQUEST_INSTALL_PACKAGES" /><uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" /><uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" /><uses-permission android:name="android.permission.WRITE_INTERNAL_STORAGE" /><uses-permission android:name="android.permission.READ_INTERNAL_STORAGE" /></config-file><icon density="ldpi" src="resources/android/icon/drawable-ldpi-icon.png" /><icon density="mdpi" src="resources/android/icon/drawable-mdpi-icon.png" /><icon density="hdpi" src="resources/android/icon/drawable-hdpi-icon.png" /><icon density="xhdpi" src="resources/android/icon/drawable-xhdpi-icon.png" /><icon density="xxhdpi" src="resources/android/icon/drawable-xxhdpi-icon.png" /><icon density="xxxhdpi" src="resources/android/icon/drawable-xxxhdpi-icon.png" /><splash density="land-ldpi" src="resources/android/splash/drawable-land-ldpi-screen.png" /><splash density="land-mdpi" src="resources/android/splash/drawable-land-mdpi-screen.png" /><splash density="land-hdpi" src="resources/android/splash/drawable-land-hdpi-screen.png" /><splash density="land-xhdpi" src="resources/android/splash/drawable-land-xhdpi-screen.png" /><splash density="land-xxhdpi" src="resources/android/splash/drawable-land-xxhdpi-screen.png" /><splash density="land-xxxhdpi" src="resources/android/splash/drawable-land-xxxhdpi-screen.png" /><splash density="port-ldpi" src="resources/android/splash/drawable-port-ldpi-screen.png" /><splash density="port-mdpi" src="resources/android/splash/drawable-port-mdpi-screen.png" /><splash density="port-hdpi" src="resources/android/splash/drawable-port-hdpi-screen.png" /><splash density="port-xhdpi" src="resources/android/splash/drawable-port-xhdpi-screen.png" /><splash density="port-xxhdpi" src="resources/android/splash/drawable-port-xxhdpi-screen.png" /><splash density="port-xxxhdpi" src="resources/android/splash/drawable-port-xxxhdpi-screen.png" /></platform><platform name="ios"><allow-intent href="itms:*" /><allow-intent href="itms-apps:*" /><icon height="57" src="resources/ios/icon/icon.png" width="57" /><icon height="114" src="resources/ios/icon/icon@2x.png" width="114" /><icon height="40" src="resources/ios/icon/icon-40.png" width="40" /><icon height="80" src="resources/ios/icon/icon-40@2x.png" width="80" /><icon height="120" src="resources/ios/icon/icon-40@3x.png" width="120" /><icon height="50" src="resources/ios/icon/icon-50.png" width="50" /><icon height="100" src="resources/ios/icon/icon-50@2x.png" width="100" /><icon height="60" src="resources/ios/icon/icon-60.png" width="60" /><icon height="120" src="resources/ios/icon/icon-60@2x.png" width="120" /><icon height="180" src="resources/ios/icon/icon-60@3x.png" width="180" /><icon height="72" src="resources/ios/icon/icon-72.png" width="72" /><icon height="144" src="resources/ios/icon/icon-72@2x.png" width="144" /><icon height="76" src="resources/ios/icon/icon-76.png" width="76" /><icon height="152" src="resources/ios/icon/icon-76@2x.png" width="152" /><icon height="167" src="resources/ios/icon/icon-83.5@2x.png" width="167" /><icon height="29" src="resources/ios/icon/icon-small.png" width="29" /><icon height="58" src="resources/ios/icon/icon-small@2x.png" width="58" /><icon height="87" src="resources/ios/icon/icon-small@3x.png" width="87" /><icon height="1024" src="resources/ios/icon/icon-1024.png" width="1024" /><splash height="1136" src="resources/ios/splash/Default-568h@2x~iphone.png" width="640" /><splash height="1334" src="resources/ios/splash/Default-667h.png" width="750" /><splash height="2208" src="resources/ios/splash/Default-736h.png" width="1242" /><splash height="1242" src="resources/ios/splash/Default-Landscape-736h.png" width="2208" /><splash height="1536" src="resources/ios/splash/Default-Landscape@2x~ipad.png" width="2048" /><splash height="2048" src="resources/ios/splash/Default-Landscape@~ipadpro.png" width="2732" /><splash height="768" src="resources/ios/splash/Default-Landscape~ipad.png" width="1024" /><splash height="2048" src="resources/ios/splash/Default-Portrait@2x~ipad.png" width="1536" /><splash height="2732" src="resources/ios/splash/Default-Portrait@~ipadpro.png" width="2048" /><splash height="1024" src="resources/ios/splash/Default-Portrait~ipad.png" width="768" /><splash height="960" src="resources/ios/splash/Default@2x~iphone.png" width="640" /><splash height="480" src="resources/ios/splash/Default~iphone.png" width="320" /><splash height="2732" src="resources/ios/splash/Default@2x~universal~anyany.png" width="2732" /></platform>

 

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.mzph.cn/news/440290.shtml

如若内容造成侵权/违法违规/事实不符,请联系多彩编程网进行投诉反馈email:809451989@qq.com,一经查实,立即删除!

相关文章

【2018ACM山东省赛 - G】Games(Nim博弈 + dp)

题干&#xff1a; Problem Description Alice and Bob are playing a stone game. There are nnn piles of stones. In each turn, a player can remove some stones from a pile (the number must be positive and not greater than the number of remaining stones in the …

LeetCode刷题实战(13):Roman to Integer

题目描述&#xff1a; 13 Roman to Integer 49.5%Easy Roman numerals are represented by seven different symbols: I, V, X, L, C, D and M. Symbol Value I 1 V 5 X 10 L 50 C 100 D …

项目总结3:ionic3开发的App在启动过程中部分手机出现白屏或黑屏问题之终极解决方案

问题场景&#xff1a;采用ionic3开发的App&#xff0c;当项目比较大的时候&#xff0c;会出现部分真机设备在启动的过程中有白屏或黑屏的情况。 原因预测&#xff1a;个别手机&#xff0c;尤其是安卓手机的性能比较差&#xff0c;App在启动后进入首页或登录页前的初始化工作还…

1.Intro to Deep Learning and Computer Vision

Intro 这是Kaggle深度学习教育课程的第一课。 在本课程结束后&#xff0c;您将了解卷积。 卷积是计算机视觉&#xff08;以及许多其他应用程序&#xff09;中深度学习模型的基本构建块。 之后&#xff0c;我们将很快开始使用世界一流的深度学习模型。 Lesson [1] from IPy…

【POJ - 2253】Frogger(floyd,或 部分瓶颈生成树的最大边)

题干&#xff1a; 湖中有n块石头&#xff0c;编号从1到n&#xff0c;有两只青蛙&#xff0c;Bob在1号石头上&#xff0c;Alice在2号石头上&#xff0c;Bob想去看望Alice&#xff0c;但由于水很脏&#xff0c;他想避免游泳&#xff0c;于是跳着去找她。但是Alice的石头超出了他…

SpringMVC常用的视图接口分类及实现类

SpringMVC中常用的视图接口分类及对应的实现类&#xff1a; URL资源视图&#xff1a;InternalResourceView、JstlView 文档视图&#xff1a;AbstractExcelView、AbstractPdfView 报表视图&#xff1a;ConfigurableJsperReportsView等JasperReports报表技术的视图 JSON视图&…

2.Building Models from Convolutions

Intro 这是深度学习课程的第2课 在本课程结束时&#xff0c;您将了解如何将卷积结合起来&#xff0c;以实现计算机视觉中的超人成就。 Lesson [1] from IPython.display import YouTubeVideo YouTubeVideo(ToBPiUlLFEY, width800, height450) Keep Going 现在你理解了模…

*【POJ - 2796】 Feel Good (前缀和优化+单调栈维护)

题干&#xff1a; Feel Good Time Limit: 3000MS Memory Limit: 65536KTotal Submissions: 12409 Accepted: 3484Case Time Limit: 1000MS Special Judge Description Bill is developing a new mathematical theory for human emotions. His recent investigations are dedi…

SpringMVC配置视图的直接映射view-controller命名空间

通常情况下&#xff0c;如果直接通过url来访问具体的视图会报404错误&#xff0c;这个时候最容易想到的解决办法是通过转发或重定向机制&#xff0c;也就说走一遍目标控制器方法拦截一次。但是最好的方法是配置视图的直接映射关系。 <mvc: view-controller path"url访…

【nyoj-456】 邮票分你一半 (dp,0-1背包的中点问题)

题干&#xff1a; 邮票分你一半 时间限制&#xff1a;1000 ms | 内存限制&#xff1a;65535 KB 难度&#xff1a;3 描述 小珂最近收集了些邮票&#xff0c;他想把其中的一些给他的好朋友小明。每张邮票上都有分值&#xff0c;他们想把这些邮票分成两份&#xff0c;并且使…

Angular中父子组件传值@Input @Output @ViewChild最全面最简单的总结

父组件传递给子组件&#xff1a; 值传递方式&#xff1a;Input既可以传递数据也可以传递方法 传递数据&#xff08;不举例了&#xff09;传递方法 // 父组件定义方法 parentRun(){alert(这是父组件的 run 方法); } 调用子组件时传入当前方法&#xff08;是传递方法不是调用方…

《TCP/IP详解》学习笔记(七):广播和多播、IGMP协议

单播&#xff0c;多播&#xff0c;广播的介绍 1单播(unicast) 单播是说&#xff0c;对特定的主机进行数据传送。例如给某一个主机发送 IP 数据包。这时候&#xff0c;数据链路层给出的数据头里面是非常具体的目的地址&#xff0c;对于以太网来说&#xff0c;就是网卡的 MAC 地…

【 POJ - 3628 】Bookshelf 2(dfs 或 dp,0-1背包)

题干&#xff1a; Farmer John recently bought another bookshelf for the cow library, but the shelf is getting filled up quite quickly, and now the only available space is at the top. FJ has N cows (1 ≤ N ≤ 20) each with some height of Hi (1 ≤ Hi ≤ 1,0…

ES5总结1:数组Array新特性最全最精简的详解

2个位置方法&#xff1a;indexOf lastIndexOf 5个迭代方法&#xff1a;forEach every some filter map 2个高阶函数&#xff1a;reduce reduceRight &#xff08;可用于数组求和&#xff09; API: 1、indexOf(searchElement: T, fromIndex?: n…

Apollo自动驾驶入门课程第③讲 — 定位

目录 1. 定位的概述 2. 定位方法介绍 2.1 GNSS RTK 2.2 惯性导航 2.3 激光雷达定位 2.4 视觉定位 2.5 Apollo定位 本文转自微信公众号&#xff1a;Apollo开发者社区 原创&#xff1a; 阿波君 Apollo开发者社区 8月17日 上周我们发布了 Apollo入门课堂第②讲—高精地图&…

【HRBUST - 1621】迷宫问题II (bfs)

题干&#xff1a; 小z身处在一个迷宫中&#xff0c;小z每分钟可以走到上下左右四个方向的相邻格之一。迷宫中有一些墙和障碍物。 同时迷宫中也有一些怪兽&#xff0c;当小z碰到任意一个怪兽时&#xff0c;小z需要将怪兽消灭掉才可以离开此方格。但消灭 怪兽会花费一定的时间。…

Linux与Bash 编程——Linux文件处理命令-L1

目录&#xff1a; linux系统与shell环境准备 Linux系统简介操作系统简史Linux的发行版&#xff1a;Linux与Windows比较&#xff1a;Linux安装安装包下载Linux的访问方式远程登录方式远程登录软件&#xff1a;mobaxterm的使用&#xff1a;使用电脑命令行连接&#xff1a;sshd的…

4.Transfer Learning

Intro 这是深度学习第4课。 在本课程结束时&#xff0c;您将能够使用迁移学习为您的自定义目标构建高度准确的计算机视觉模型&#xff0c;即使您的数据相对较少。 Lesson [1] from IPython.display import YouTubeVideo YouTubeVideo(mPFq5KMxKVw, width800, height450) S…

Angular相关的有价值的问题集锦

001. Angular的三大核心概念是什么&#xff1f; 答&#xff1a;组件化、模块化和路由&#xff08;Component、NgModule、Router&#xff09;,其中最核心的概念是组件化Component。 002. 前端为什么需要Router&#xff1f; 答&#xff1a;如果没有Router&#xff0c;浏览器的…

如何在Word中排版出漂亮规整的编程语言代码样式?【☆】

[1] 能输出各种编程语言并保持代码格式和语法高亮显示的网站&#xff1a; PlanetB | Syntax Highlight Code in Word Documents http://www.planetb.ca/syntax-highlight-word Welcome! — Pygments http://pygments.org/ [2] How do you display code snippets in MS Wor…