Ionic adds icon and splash--reproduced

When we use ionic to create an app, the default logo and splash page are cordova icons, which are not very good-looking. How to use our own icon and splash page?

1、icon generation

  1. Generate a 192*192px logo, save it as icon.png, icon.ai or icon.psd (only these three formats are supported), the picture should not have rounded corners (each platform will add effects to the picture by itself, such as ios will automatically Add rounded corners to the logo).
  2. There is a resources directory in the root directory of ionic, and the image of the icon is placed in this directory.
  3. Run the command to generate icons for different platforms.
    $ ionic resources --icon
    After running the command, you will find that a series of images of different sizes are generated, and there will be corresponding configurations in config.xml.

2. splash page

  1. Generate a 2208x2208 px splash image and save it as splash.png, splash.ai or splash.psd.
  2. There is a resources directory in the root directory of ionic, and the image of the icon is placed in this directory.
  3. Run the command to add the splash plugin
    $ ionic plugin add https://github.com/apache/cordova-plugin-splashscreen.git
  4. Run the command to generate splash for different platforms
    $ ionic resources --splash
    After running the command, you will find that a series of images of different sizes are generated, and there will be corresponding configurations in config.xml.

Note: Running ionic resources directly will automatically process icon and splash images, which is much more convenient

3. Configuration for different platforms

The above configuration pairs of icon and splash are for all platforms. If you want to use different configurations for ios, android, etc., you can find that there are corresponding ios/ and android/ directories in the resource directory. Place it in the corresponding directory, and then run the ionic resources command.



Author: Bu Kun
Link: http://www.jianshu.com/p/eda363eb28d3

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=326485575&siteId=291194637