• ios 的 desciption


    前段时间,终于将 ipa 文件打包完毕,上传appStore ,最后被打回,是因为 敏感的调用设备功能没有写描述。

    有两种解决方式:

    A.直接修改 info.plist 文件

    1、设置启动图标(CFBundleIcons)

    <key>CFBundleIcons</key>
    <dict>
        <key>CFBundlePrimaryIcon</key>
        <dict>
            <key>CFBundleIconFiles</key>
            <array>
                <string>Icon</string>
                <string>Icon@2x</string>
                <string>Icon_120@2x</string>
            </array>
        </dict>
    </dict>
    

    2、设置启动闪屏图片(UILaunchImages)

    <key>UILaunchImages</key>
    <array>
        <dict>
            <key>UILaunchImageMinimumOSVersion</key>
            <string>7.0</string>
            <key>UILaunchImageName</key>
            <string>Default</string>
            <key>UILaunchImageOrientation</key>
            <string>Portrait</string>
            <key>UILaunchImageSize</key>
            <string>{320, 568}</string>
        </dict>
        <dict>
            <key>UILaunchImageMinimumOSVersion</key>
            <string>7.0</string>
            <key>UILaunchImageName</key>
            <string>Default</string>
            <key>UILaunchImageOrientation</key>
            <string>Portrait</string>
            <key>UILaunchImageSize</key>
            <string>{320, 480}</string>
        </dict>
    </array>
    

    3、设置版本号相关

    (1)设置Bundle的版本号(Bundle versions string, short)。

    一般包含该束的主、次版本号,这个字符串的格式通常是“n.n.n”(n表示某个数字,如1.1.1)。第一个数字是束的主要版本号,另两个是次要版本号。该关键字的值会被显示在Cocoa应用程序的关于对话框中。该关键字不同于CFBundleVersion,它指定了一个特殊的创建号。而CFBundleShortVersionString的值描述了一种更加正式的并且不随每一次创建而改变的版本号。

    <key>CFBundleShortVersionString</key>
    <string>1.0</string>

    (2)设置应用程序版本号(Bundle version)。

    每次部署应用程序的一个新版本时,将会增加这个编号,用于标识不同的版本。

    <key>CFBundleVersion</key>
    <string>1.0</string>

    4、设置字体相关(Fonts provided by application)

    在iOS应用中需要使用系统提供的字体之外的字体,可以将字体文件(.ttf/.odf)复制到项目文件中,另外需要在Info.plist中添加Fonts provided by application的项,对应的源码文件如下:

    <key>UIAppFonts</key>
    <array>
        <string>华文行楷.ttf</string>
        <string>华文新魏.ttf</string>
        <string>黑体_GB2312.ttf</string>
    </array>

    P.S关于如何使用系统支持的字体信息:

    (1)在调用字体的时候,要使用字体名。字体名不是文件名,而是字体的Family Name。Family Name可以在Font Book中查看。

    label.font = [UIFont fontWithName:@"字体名称" size:16.0];

    (2)遍历出系统支持的全部字体

    NSArray *familyNames = [[NSArray alloc] initWithArray:[UIFont familyNames]];
    for(int indFamily = 0; indFamily < familyNames.count; ++indFamily)
    {
        NSLog(@"Family Name: %@", [familyNames objectAtIndex:indFamily]);
        NSString *fontFamilyName = [familyNames objectAtIndex:indFamily];
        NSArray *fontNames = [[NSArray alloc] initWithArray:[UIFont fontNamesForFamilyName:fontFamilyName]];
        for(int indFont = 0; indFont < fontNames.count; ++indFont)
        {
            NSLog(@"   Font Name: %@", [fontNames objectAtIndex:indFont]);
        }
    }

    5、设置应用名称(Bundle display name)

    <key>CFBundleDisplayName</key>
    <string>应用程序名称</string>

    可以通过在InfoPlist.strings中使用配置让应用在不同的语言环境下显示不同的应用名称,如在English中使用CFBundleDisplayName="Hello World";配置应用程序的名称为Hello World,在Chinese的环境下使用CFBundleDisplayName="你好世界";配置应用程序的名称为你好世界

    6、设置应用标识号(Bundle identifier)

    <key>CFBundleIdentifier</key>
    <string>com.devzeng.demo</string>

    7、设置应用支持的屏幕方向(Supported interface orientations)

    iOS应用程序支持以下四个方向的设置:UIInterfaceOrientationPortrait(默认竖直方向,HOME键向下)、UIInterfaceOrientationLandscapeLeft(横屏靠左)、UIInterfaceOrientationLandscapeRight(横屏向右)和UIInterfaceOrientationPortraitUpsideDown(竖直方向倒置,HOME键向上)

    对应的配置源码如下:

    <key>UISupportedInterfaceOrientations</key>
    <array>
        <string>UIInterfaceOrientationPortrait</string>
        <string>UIInterfaceOrientationLandscapeLeft</string>
        <string>UIInterfaceOrientationLandscapeRight</string>
        <string>UIInterfaceOrientationPortraitUpsideDown</string>
    </array>

    8、设置应用程序是否支持后台运行(Application does not run in background)

    通过UIApplicationExitsOnSuspend可以设置iOS的应用程序进入到挂起状态下是否立即退出,设置为YES表示不支持后台运行退出到后台立即退出,设置为NO表示支持后台运行。

    (1)设置支持后台运行

    <key>UIApplicationExitsOnSuspend</key>
    <false/>

    (2)设置不支持后台运行

    <key>UIApplicationExitsOnSuspend</key>
    <true/>

    B.通过xcode 配置

    下面是这个文件的一个例子:

  • 相关阅读:
    [原]小巧的刀片
    [原]看康震教授讲《卖油翁》有感
    [原]使用可传输表空间修改Schema Name
    [原]ORA00060: Deadlock detected(场景1:单表并发更新)
    [原]使用wget/curl做个“小后门”
    [原]一个空格导致NFS的Readonly
    [转]设计高效SQL: 一种视觉的方法
    [原]6Gb/s SAS 2.0 通道的确不错
    ESX 4/VSphere CentOS 启动时 udev Hang 住
    [摘]终于找到一个有助理解left/right/full outer join的例子
  • 原文地址:https://www.cnblogs.com/crazycode2/p/6352269.html
Copyright © 2020-2023  润新知