Flutter轻松入门(五)-- 启动界面

2018-06-18  本文已影响0人  SuperGino

Android添加启动界面

打开文件 android/app/src/main/res/drawable/launch_background.xml

修改内容,打开注释了的代码launch_image那段。

<?xml version="1.0" encoding="utf-8"?>
<!-- Modify this file to customize your launch splash screen -->
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
    <item android:drawable="@android:color/white" />

    <!-- You can insert your own image assets here -->
    <item>
        <bitmap
            android:gravity="center"
            android:src="@mipmap/launch_image" />
    </item>
</layer-list>

注意@mipmap/launch_image就是你要设置的启动界面的图片资源名字,你要放置到对应的文件夹里面


image.png

IOS添加启动界面

ios系统比较简单,使用xcode打开项目ios工程,选择Assets.xcassets/LaunchImage.imageset,然后根据提示拖入对应的启动图片


image.png
上一篇 下一篇

猜你喜欢

热点阅读