AppIcon 的规格
规格这个由美术UI给出,具体的设计规格可以参考官方给出的规格要求
App Icons on iPhone, iPad and Apple Watch
AppIcon 的设置
设置资源放在项目的 Assets.xcassets
配置位置如下图 (可以设置app图标和启动界面)
![](https://img.haomeiwen.com/i1084998/d006f07515085a37.png)
我们来看看新建一个项目中,Assets.xcassets
![](https://img.haomeiwen.com/i1084998/913dfc0debdb8ae7.jpg)
准备好我们的项目Icon(规格上图可以看出是 20 29 40 60),拖入到这个文件夹中,并运行看效果
![](https://img.haomeiwen.com/i1084998/5dc67c7edc3b841e.png)
![](https://img.haomeiwen.com/i1084998/cc0583fe62011b24.gif)
AppIcon 的设置完毕
App名字 的设置
我们先来看看 Info.plist文件的元信息,项目中的配置大多数都在这里
![](https://img.haomeiwen.com/i1084998/77c20fe9f73195f4.png)
这些属性,我们只看和我们想要设置的App名字相关的 Bundle name
你还能看到"Bundle Name" and "Bundle display name"都设置为动态参数${PRODUCT_NAME}。
Bundle name - is folder name, where your app (including executable file and all resources) will be stored (Cool Program.app)。建议不要修改bundle name
Bundle display name - is what will be shown on iPhone screen,即当你安装该app到iPhone上显示的name。
注意:Bundle Display name must correspond to Bundle name,即bundle display name和bundle name不能相差太远。例如bundle name设置为 TheApplication, 而 bundle display name设置为“金瓶梅”,则apple会拒绝你的app。
但是上面我们新建一个项目的时候,我们并没有看到有 Bundle Display name,这个key对应的是,我们app在手机上显示的名称,默认情况如果不设置,Bundle Display name的取值,是取Bundle name的值,从上面的图片我们可以看到,App名字是我们项目的名称:AppIcon
设置 Bundle Display name
![](https://img.haomeiwen.com/i1084998/4afb29d6f080c973.png)
![](https://img.haomeiwen.com/i1084998/5be7363f58f397bb.png)
![](https://img.haomeiwen.com/i1084998/2a1e97382d008ff9.png)
如果我们去掉设置面板的 Display name ,Info.plist中的Bundle Display name也会消失掉。
![](https://img.haomeiwen.com/i1084998/62d45153582b0916.gif)
我们在Info.plist新建一个Bundle Display name,也可以设置,一样的效果。
![](https://img.haomeiwen.com/i1084998/08f43b585003fe1c.gif)
App 启动页的设置
模拟器快捷键小技巧
command+shift+H 按一次 相当 HOME
command+shift+H 按两次 可以关闭应用程序
首先我们来看下,启动页设置选项,有下面两个
![](https://img.haomeiwen.com/i1084998/6be403cac4f83d43.png)
系统默认是加载一个 LaunchScreen.storyboard,下面是演示和验证,我们在LaunchScreen.storyboard中添加一个按钮来启动app,可以看到启动页LaunchScreen.storyboard的变化
![](https://img.haomeiwen.com/i1084998/ce112aee779ccbe5.gif)
但是,通常情况下我会直接使用 Launch Images Source 方式展示启动图,省去了为启动图做适配的工作,只需要设计师提供不同尺寸的图片资源就可以了。我们先删除默认设置的LaunchScreen.storyboard,选择 Launch Images Source,会在Assets.xcassets 生成一个LaunchImage的Assets,然后选中LaunchImage点击设置下面的内容,把我们准备好的图片拖进去设置好就可以了。
![](https://img.haomeiwen.com/i1084998/aa4b5945443c91b8.png)
我们来启动看一下效果:
![](https://img.haomeiwen.com/i1084998/2d671baa84a731fc.gif)
演示完毕..
网友评论