
第android
89
ios
次推文
web
LZ-Saysjson
追随鸡老大,点滴积累~微信
前言app
对于什么都不懂直接上手 Flutter 开发的小 Android 而言,想要保证进度的同时还能帮助公司小伙伴,只能晚上熬夜补裤裆,各类翻阅官方以及前辈的文章。
flex
仍是但愿本身整理一份属于本身的东西,若干年后,点击查看,还能回想起如今艰辛讨生活的本身如何在帝都各类熬夜,而后和孩子吹牛逼~ 😂😂😂网站
动笔前,犹豫很久,要怎么样轰轰烈烈来篇记录呢?想一想各位掘金大佬,仍是不得瑟了,依旧项目状况,整理本身的 Flutter 笔记,而后慢慢进行了解 Flutter 吧~ui
附上以前基于 macOS 配置 Flutter 连接,方便往后本身查看:this
加油呀,万一一不当心优秀了呢~
1、移动端 Icon 替换
1. Android 修改应用图标
经过 Android Studio 打开 Flutter 中 android Module,右键选择 “New ===> Image Asset”:
随后打开对应 Icon,调整大小:
此时会自动为你在不一样的分辨率下生成对应的 Icon:
调整 AndroidManifest 文件:
<application android:name="io.flutter.app.FlutterApplication" android:icon="@mipmap/ic_launcher" android:label="studyapp" android:roundIcon="@mipmap/ic_launcher_round"> <!-- 添加对于圆形 Icon 支持 -->
2. iOS 修改应用图标
找了个图标生成网站:
icon.wuruihong.com/
上传对应的 Icon 选择生成的一些基本参数,这里感受默认就够用了:
随后选择默认开始生成:
随后查看效果,生成速度很快~
接下来用 Xcode 打开对应的 ios module,替换对应资源:
下载已生成的图标,选取 iOS 图标资源复制到如下地址中:
ios ===> Runner ===> Assets.xcassets ===> AppIcon.appiconset
随后替换 Contents.json 文件便可。
俩者一对比,仍是 Android 好,哈哈哈~
2、移动端启动页处理
1. Android 修改启动页
Step 1:为 Android Style 中新增全屏样式:
<?xml version="1.0" encoding="utf-8"?><resources> <!-- Fullscreen Style --> <style name="FullScreenTheme" parent="@android:style/Theme.Black.NoTitleBar"> <item name="android:windowFullscreen">true</item></style>
<!-- Theme applied to the Android Window while the process is starting --> <style name="LaunchTheme" parent="FullScreenTheme"> <!-- Show a splash screen on the activity. Automatically removed when Flutter draws its first frame --> <item name="android:windowBackground">@drawable/launch_background</item></style> <!-- Theme applied to the Android Window as soon as the process has started. This theme determines the color of the Android Window while your Flutter UI initializes, as well as behind your Flutter UI while its running.
This Theme is only used starting with V2 of Flutter's Android embedding. --> <style name="NormalTheme" parent="FullScreenTheme"> <item name="android:windowBackground">@android:color/white</item></style></resources>
查看下面截图可看详细目录地址:
Step 2:修改 launch_background 文件
先把 UI 给你提供的启动页图片对应的放在 drawable 中。
随后开启定义你的启动页图片:
<?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="fill" android:src="@drawable/launch_image" /> </item></layer-list>
Step 3:运行查看效果
效果以下,我这是随便反编译一个 Apk 拿到的启动图:
2. iOS 修改启动页
这块我以为 iOS 还蛮不错的,很 easy,替换下面的三张图就好:
效果都同样,这里就不放置效果图咯。
有个坑点就是少用模拟器,模拟器运行发现会有较长一段时间白屏,实际运行真机则没有这个问题。郁闷了我。
3、修改应用名称
1. 修改 Android 应用名称
按照以下地址,打开 AndroidManifest 并修改 application 节点下的 android:label 内容便可:
android ===> app ===> src ===> main ===> AndroidManifest
2. 修改 iOS 应用名称
按照以下地址修改 info.plist 中的 CFBundleName 值:
ios ===> Runner ===> Info.plist ===> CFBundleName
Thanks
添加资源和图片
App Icon
欢迎各位关注
不按期发布
见证成长路




本文分享自微信公众号 - 贺利权(hlq_struggle)。
若有侵权,请联系 support@oschina.cn 删除。
本文参与“OSC源创计划”,欢迎正在阅读的你也加入,一块儿分享。