美文网首页
IOS基础-APP图标、启动页、名字的设置

IOS基础-APP图标、启动页、名字的设置

作者: Joe_zShare | 来源:发表于2018-03-27 16:09 被阅读810次

    AppIcon 的规格

    规格这个由美术UI给出,具体的设计规格可以参考官方给出的规格要求

    App Icons on iPhone, iPad and Apple Watch

    AppIcon 的设置

    设置资源放在项目的 Assets.xcassets
    配置位置如下图 (可以设置app图标和启动界面)


    配置位置

    我们来看看新建一个项目中,Assets.xcassets


    Assets.xcassets

    准备好我们的项目Icon(规格上图可以看出是 20 29 40 60),拖入到这个文件夹中,并运行看效果


    拖入其中
    演示效果

    AppIcon 的设置完毕

    App名字 的设置

    我们先来看看 Info.plist文件的元信息,项目中的配置大多数都在这里


    Info.plist

    这些属性,我们只看和我们想要设置的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

    在app设置面板输入然后回车 在Info.plist自动生成Bundle Display name 效果图

    如果我们去掉设置面板的 Display name ,Info.plist中的Bundle Display name也会消失掉。


    去掉Display name 内容

    我们在Info.plist新建一个Bundle Display name,也可以设置,一样的效果。


    添加Bundle Display name

    App 启动页的设置

    模拟器快捷键小技巧

    command+shift+H 按一次 相当 HOME
    command+shift+H 按两次 可以关闭应用程序

    首先我们来看下,启动页设置选项,有下面两个


    启动页设置选项

    系统默认是加载一个 LaunchScreen.storyboard,下面是演示和验证,我们在LaunchScreen.storyboard中添加一个按钮来启动app,可以看到启动页LaunchScreen.storyboard的变化

    启动页演示

    但是,通常情况下我会直接使用 Launch Images Source 方式展示启动图,省去了为启动图做适配的工作,只需要设计师提供不同尺寸的图片资源就可以了。我们先删除默认设置的LaunchScreen.storyboard,选择 Launch Images Source,会在Assets.xcassets 生成一个LaunchImage的Assets,然后选中LaunchImage点击设置下面的内容,把我们准备好的图片拖进去设置好就可以了。


    设置启动页注意事项

    我们来启动看一下效果:


    换启动页启动效果

    演示完毕..

    相关文章

      网友评论

          本文标题:IOS基础-APP图标、启动页、名字的设置

          本文链接:https://www.haomeiwen.com/subject/jcpjcftx.html