反応ネイティブアプリのアイコンとスプラッシュ(アンドロイド)

一般的な携帯電話の解像度で初見

//   mdpi    480*320
//   hdpi    800*480
//   xhdpi   1280*720
//   xhdpi   1920*1080

APP修正名

検索アンドロイド/アプリ/ srcに/メイン/ AndroidManifest.xmlを

<application
            android:name=".MainApplication" android:label="@string/app_name" android:icon="@mipmap/ic_launcher" android:allowBackup="false" android:theme="@style/AppTheme"> </application> 

発見アンドロイド:= "@文字列/ APP_NAME" のラベル。この対応は、APPの名前です。

入力:アンドロイド/アプリ/ srcに/メイン/ RES / valuse /ディレクトリのstrings.xml

<resources>
    <string name="app_name">APP名称</string> </resources> 

APPは、アイコンを変更しました

1、APPのアイコンを読み込むための場所を見つけます

ディレクトリを入力します::アンドロイド/アプリ/ srcに/メイン/ AndroidManifest.xmlを

<application
            android:name=".MainApplication" android:label="@string/app_name" android:icon="@mipmap/ic_launcher" android:allowBackup="false" android:theme="@style/AppTheme"> </application> 

あなたは、このため、アイコンのミップマップは、ファイルにic_launcher絵で、アンドロイド/アプリ/ srcに/メイン/の中に新しいmipmap_hdpi見ることができる解像度、mipmap_mdpi、mipmap_xhdpi、mipmap_xxhdpi ic_launcher写真を保存したファイルを、
解像度は72x72あり、48×48 、に96x96、144x144,192 * 192

スプラッシュを変更

アタッチ住所:https://github.com/crazycodeboy/react-native-splash-screen

インストール
npm install react-native-splash-screen --save react-native link react-native-splash-screen 
リンクをチェック

settings.gradle

include ':react-native-splash-screen'
project(':react-native-splash-screen').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-splash-screen/android') 

build.gradle

compile project(':react-native-splash-screen')

MainApplication.java

import org.devio.rn.splashscreen.SplashScreenReactPackage;

new SplashScreenReactPackage()
ページの設定を開始します

アンドロイド/アプリの新しいレイアウトファイル/ srcに/メイン/ resを、launch_screen.xml

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:orientation="vertical" android:layout_width="match_parent" android:layout_height="match_parent" android:background="@drawable/launch_screen"> </LinearLayout> 

MainActivity.java

import android.os.Bundle; import org.devio.rn.splashscreen.SplashScreen; protected void onCreate(Bundle savedInstanceState) { SplashScreen.show(this); // <--添加这一句 super.onCreate(savedInstanceState); } 

アンドロイド/アプリ/ srcに/メイン/のlaunch_screen画像に格納されている新drawable_hdpi、drawable_mdpi、drawable_xhdpi、drawable_xxhdpiファイル、解像度、
それぞれの解像度は、解像度に言及した記事の冒頭のために、
あなたの最初のページを増やします

import SplashScreen from 'react-native-splash-screen';

componentDidMount() { SplashScreen.hide(); //关闭启动屏幕 } 

この時点で、全体のスタートページが完成します

 
 
1人が親指
 

おすすめ

転載: www.cnblogs.com/chenzxl/p/11426194.html