Skip to content

一行代码修改启动图,以及自动修改启动图显示异常

License

Notifications You must be signed in to change notification settings

internetWei/LLaunchScreen

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

LLaunchScreen

LLaunchScreen CI   License MIT   CocoaPods   Platform   Support   blog

自动修复iPhone启动图显示异常,1行代码修改启动图 建议使用OC版本,Swift版本后续将不再升级维护。

OC版本

特性

  • 自动修复启动图显示异常
  • 1行代码修改启动图
  • 兼容iOS13以下系统

Demo

动态修改启动图 修复启动图异常
demo.gif repair.gif

前提

由于Swift语言的限制,有些初始化操作需要您手动执行:

  1. 请在application(_ , didFinishLaunchingWithOptions :)方法返回前执行LLaunchScreen.finishLaunching()
  2. 请在修改启动图的逻辑前调用LLaunchScreen.backupSystemLaunchImage()

用法

// 将所有启动图恢复为默认启动图(Restore all launch screen to the initial state)
LLaunchScreen.restoreAsBefore()

// 替换指定类型启动图(Replace the specified type of launch Image)
LLaunchScreen.replaceLaunchImage(replaceImage: replaceImage, type: .verticalLight, quality: 0.8, validation: nil)

// 自定义暗黑系启动图的校验规则,请写在finishLaunching()方法前(Customize the verification rules of the dark style launch screen, Please write before finishLaunching() method)
LLaunchScreen.hasDarkImageBlock = {
    
}

// 获取指定模式下的本地启动图(Get the local launch screen diagram in the specified mode)
LLaunchScreen.launchImage(from: .verticalLight)

安装

CocoaPods

  1. 在 Podfile 中添加 pod 'LLaunchScreen'
  2. 执行 pod install --repo-update
  3. import LLaunchScreen

手动安装

  1. 下载LLaunchScreen文件夹内的所有内容
  2. LLaunchScreen文件夹添加(拖放)到你的工程

系统要求

该项目最低支持iOS9.0和Xcode10.0,如果想在更低系统上使用可以联系作者

注意点

  • 替换图片的尺寸建议和屏幕物理分辨率保持一致
  • APP更新版本后,第一次打开APP会显示默认启动图,这是系统限制,暂时没办法解决
  • 可以修改iPad启动图,但是并不完美,后续版本会适配

联系作者

如果你有更好的改进,please pull reqeust me

如果你有任何更好的意见,请创建一个Issue

可以通过此邮箱联系作者[email protected]

LLaunchScreen设计思路

待办事项

  • 完善iPad的启动图修复与替换
  • 支持Carthage

许可证

LLaunchScreen 使用 MIT 许可证,详情见 LICENSE 文件