当前位置: 首页 > news >正文

生成iOS LaunchImage脚本

组件

react-native-splash-screen

注意事项

脚本没有设置生成ios LaunchImage的路径,需要把图片复制到ios/YourProjectname/Images.xcassets/LaunchImage.launchimage

脚本

脚本来自己git上的一个用户,链接贴上了,我额外增加了一些比较新的分辨率。

# https://gist.github.com/roblabs/d2c3536760755de7715d2248e7854444
#!/bin/bash -e# --------------------------------------------------------
# Generate iOS Launch items from a single image
# (c) 2017 ePi Rational, Inc.
#
# Modified from original script which generated app icons for iOS,
# originally written by
# Ben Clayton, Calvium Ltd.
#  https://gist.github.com/benvium/2be6d673aa9ac284bb8a
# --------------------------------------------------------# Process
# As of 2017, the largest launch screen for iOS is.
# 12.9-inch iPad Pro | 2048px by 2732px | `Default-1366h@2x.png`
# 12.9-inch iPad Pro | 2732px by 2048px | `Default-Landscape-1366h@2x.png`
#
# The idea is to create a portrait and landscape at the above sizes,
# then use ImageMagick to scale.
# ImageMagick steps
#   * create a white background with the desired image extent
#   * scale the large image, while tending towards the center
#   * testing showed that the `-resize` alone did not properly create the final image sizes.# Check imagemagick is installed
# http://stackoverflow.com/questions/592620/check-if-a-program-exists-from-a-bash-script
command -v magick >/dev/null 2>&1 || { echo >&2 "Requires imagemagick, but it's not installed.  See http://www.imagemagick.org.  Aborting."; exit 1; }# Uses the largest images as the base image for generating the others
portrait="splash_20240809.png"
landscape="splash_20240809.png"#magick $portrait -resize 320x480 -gravity center -background white -extent 320x480 Default.png
magick $portrait -resize 640x960 -gravity center -background white -extent 640x960 Default@2x.png
magick $portrait -resize 1024x768 -gravity center -background white -extent 1024x768 Default-Landscape.png
magick $portrait -resize 2048x1536 -gravity center -background white -extent 2048x1536 Default-Landscape@2x.png
magick $portrait -resize 768x1024 -gravity center -background white -extent 768x1024 Default-Portrait.png
magick $portrait -resize 1536x2048 -gravity center -background white -extent 1536x2048 Default-Portrait@2x.png
# magick $portrait -resize 1080x1920 -gravity center -background white -extent 1080x1920 Default-640h@3x.png
magick $portrait -resize 1242x2208 -gravity center -background white -extent 1242x2208 Default-Portrait-736h@3x.png
magick $portrait -resize 1125x2436 -gravity center -background white -extent 1125x2436 Default-Portrait-812h@3x.png
# magick $landscape -resize 1920x1080 -gravity center -background white -extent 1920x1080 Default-Landscape-640h@3x.png
magick $portrait -resize 750x1334 -gravity center -background white -extent 750x1334 Default-667h@2x.png
# magick $landscape -resize 1334x750 -gravity center -background white -extent 1334x750 Default-Landscape-667h@2x.png
magick $portrait -resize 640x1136 -gravity center -background white -extent 640x1136 Default-568h@2x.png
# magick $landscape -resize 1136x640 -gravity center -background white -extent 1136x640 Default-Landscape-568h@2x.png
# magick $landscape -resize 2048x2732 -gravity center -background white -extent 2048x2732 Default-1366h@2x.png
# magick $landscape -resize 2732x2048 -gravity center -background white -extent 2732x2048 Default-Landscape-1366h@2x.png
# magick $portrait -resize 1536x2048 -gravity center -background white -extent 1536x2048 Default-1024h@2x.png
# magick $landscape -resize 2048x1536 -gravity center -background white -extent 2048x1536 Default-Landscape-1024h@2x.png
magick $portrait -resize 2436x1125 -gravity center -background white -extent 2436x1125 Default-Landscape-812h@3x.png
magick $portrait -resize 2208x1242 -gravity center -background white -extent 2208x1242 Default-Landscape-736h@3x.png# **Splash Screens** | Portrait & Landscape, [iOS Human Interface Guidelines](https://developer.apple.com/ios/human-interface-guidelines/graphics/launch-screen/) | ![](assets/README-2dc5de66.png)
# Default (Portrait)|	320px by 480px | `Default.png`
# Default (Portrait)|	640px by 960px | `Default@2x.png`
# iPad |	1024px by 768px | `Default-Landscape.png`
# iPad Retina |	2048px by 1536px | `Default-Landscape@2x.png`
# iPad |	768px by 1024px | `Default-Portrait.png`
# iPad Retina |	1536px by 2048px | `Default-Portrait@2x.png`
# iPhone 6s Plus, iPhone 6 Plus |	1080px by 1920px | `Default-640h@3x.png`
# iPhone 6s Plus, iPhone 6 Plus |	1920px by 1080px | `Default-Landscape-640h@3x.png`
# iPhone 6s, iPhone 6 | 750px by 1334px | `Default-667h@2x.png`
# iPhone 6s, iPhone 6 | 1334px by 750px | `Default-Landscape-667h@2x.png`
# iPhone SE | 640px by 1136px | `Default-568h@2x.png`
# iPhone SE | 1136px by 640px | `Default-Landscape-568h@2x.png`
# 12.9-inch iPad Pro | 2048px by 2732px | `Default-1366h@2x.png`
# 12.9-inch iPad Pro | 2732px by 2048px | `Default-Landscape-1366h@2x.png`
# 9.7-inch iPad Pro, iPad Air 2, iPad mini 4, iPad mini 2 | 1536px by 2048px | `Default-1024h@2x.png`
# 9.7-inch iPad Pro, iPad Air 2, iPad mini 4, iPad mini 2 | 2048px by 1536px | `Default-Landscape-1024h@2x.png`

相关文章:

  • 北京网站建设多少钱?
  • 辽宁网页制作哪家好_网站建设
  • 高端品牌网站建设_汉中网站制作
  • “服务之巅:Spring Cloud中SLA监控与管理的艺术“
  • 【JavaEE】初步认识多线程
  • 【论文泛读】ZKML: An Optimizing System for ML Inference in Zero-Knowledge Proofs
  • springboot自定义starter
  • 【漏洞复现】某赛通数据泄露防护(DLP)系统 NetSecConfigAjax SQL注入漏洞
  • docker docker-compose创建容器并运行时发现redis.conf: Is a directory
  • springboot+neo4j的demo
  • 【论文分享】基于非参数方法和无所不在的兴趣点数据的子中心识别——以284个中国
  • tianai-captcha SpringBoot 行为验证码 支持滑动、旋转、文字点选等
  • 线程池概述
  • 在 FastAPI 项目中使用 Python 注解类型实现通用返回结构
  • docker的基本管理和应用
  • Linux磁盘管理与文件系统(二):实用工具和命令、fdisk分区示例
  • 【QGroundControl二次开发】十. QT添加GStreamer视频播放同时保存
  • 【C++ 秘籍】解锁 stack、queue 和 priority_queue 及容器适配器的神奇世界
  • 《Java8实战》-第四章读书笔记(引入流Stream)
  • 07.Android之多媒体问题
  • 2017 年终总结 —— 在路上
  • create-react-app项目添加less配置
  • Effective Java 笔记(一)
  • ES6系统学习----从Apollo Client看解构赋值
  • ES学习笔记(12)--Symbol
  • extract-text-webpack-plugin用法
  • Hibernate最全面试题
  • JavaScript类型识别
  • Java比较器对数组,集合排序
  • macOS 中 shell 创建文件夹及文件并 VS Code 打开
  • MYSQL 的 IF 函数
  • node学习系列之简单文件上传
  • npx命令介绍
  • oldjun 检测网站的经验
  • scala基础语法(二)
  • SOFAMosn配置模型
  • Spring Cloud Feign的两种使用姿势
  • Spring Security中异常上抛机制及对于转型处理的一些感悟
  • v-if和v-for连用出现的问题
  • 产品三维模型在线预览
  • 彻底搞懂浏览器Event-loop
  • 浮动相关
  • 构建二叉树进行数值数组的去重及优化
  • 记一次删除Git记录中的大文件的过程
  • 如何设计一个比特币钱包服务
  • 使用agvtool更改app version/build
  • 我与Jetbrains的这些年
  • 策略 : 一文教你成为人工智能(AI)领域专家
  • ​flutter 代码混淆
  • ​LeetCode解法汇总2182. 构造限制重复的字符串
  • ​一帧图像的Android之旅 :应用的首个绘制请求
  • ​直流电和交流电有什么区别为什么这个时候又要变成直流电呢?交流转换到直流(整流器)直流变交流(逆变器)​
  • ###C语言程序设计-----C语言学习(3)#
  • #《AI中文版》V3 第 1 章 概述
  • #数据结构 笔记三
  • (1)Android开发优化---------UI优化
  • (1/2) 为了理解 UWP 的启动流程,我从零开始创建了一个 UWP 程序
  • (10)STL算法之搜索(二) 二分查找