此版本仅针对Xcode 11.7,不同版本的Xcode可能略有不同,请自行甄别.
步骤如下:
1、创建项目:
导入图片素材:
下图中,3可以修改名称,后面会用到,在4的位置1x,2x,3x分别导入对应规格的图片
素材导入完成后回到LaunchScreen.storyboard,选中View,Content Mode选择Aspect Fill,Background建议跟背景图同样颜色,不然在暗黑模式下容易有黑边产生.
找到Image View,在右侧的image里就可以找到刚刚导入的图片素材,
如果是要铺满全屏的那种背景,建议选择iPhone 11 ProMax,否则如果选一个小尺寸的做适配切换到大尺寸的时候,会有空白.
Content Mode最好选择Aspect Fill,这个会自动裁剪,比较符合UI,不会拉伸图片或者铺不满全屏.
根据红圈里选定的操作,其他元素拖动完弄好位置后,也按照这个操作.
导出storayboard文件:
导出后,得到红圈1中的文件,然后把拖到xcode里用的图片素材的2x和3x的素材放到根目录,即图2,拖进去多少个素材就放多少个,名称必须一一对应,不能更改,红圈3里就是红圈1和红圈2一起打包的压缩包,用来放在uniapp里用.
Fantastic read! I was especially impressed by the depth provided on the topic, offering a perspective I hadn’t considered. Your insight adds significant value to the conversation. For future articles, it would be fascinating to explore more to dive deeper into this subject. Could you also clarify more about the topic? It caught my interest, and I’d love to understand more about it. Keep up the excellent work!