Anonymous 发表于 2016-1-30 13:29:53

Air for IOS 配置文件设置说明

<h1 style="font-size: 26px; line-height: 39px; font-family: Verdana, Arial, Helvetica, sans-serif, SimSun-18030; margin-top: 8px; margin-bottom: 12px; color: rgb(0, 0, 0); ">iOS 设置</h1><table id="inner_content_table" width="100%" border="0" cellspacing="0" cellpadding="0" style="font-size: 12px; line-height: 18px; font-family: Verdana, Arial, Helvetica, sans-serif, SimSun-18030; border-spacing: 0px; margin-top: 10px; margin-bottom: 12px; color: rgb(0, 0, 0); "><tbody><tr><td style="margin-left: 2px; padding: 0px 0px 0px 2px; vertical-align: top; "><div style="border-top-color: rgb(204, 204, 204); border-top-style: solid; border-top-width: 1px; "><p style="margin-bottom: 8px; "></p></div><div id="minitoc" style="margin-bottom: 16px; "><div class="t" style="margin-bottom: 4px; "><div class="b" style="margin-bottom: 4px; "><div style="margin-bottom: 4px; "><ul id="minitoc-links" style="margin-bottom: 4px; list-style: square; "><li style="margin-bottom: 4px; margin-left: 18px; list-style: inherit !important; "><p style="margin-bottom: 4px; "><a href="http://help.adobe.com/zh_CN/air/build/WSfffb011ac560372f7e64a7f12cd2dd1867-8000.html#WSd6d4f896b3a8801b-15a1d5f91370ecb9970-8000" style="text-decoration: none; color: rgb(0, 125, 216); margin-bottom: 4px; "><span class="topictitle1" style="margin-bottom: 4px; ">支持 iOS 上的后台任务</span></a></p></li><li style="margin-bottom: 4px; margin-left: 18px; list-style: inherit !important; "><p style="margin-bottom: 4px; "><a href="http://help.adobe.com/zh_CN/air/build/WSfffb011ac560372f7e64a7f12cd2dd1867-8000.html#WS901d38e593cd1bac6c9d409a12e26b451be-8000" style="text-decoration: none; color: rgb(0, 125, 216); margin-bottom: 4px; "><span class="topictitle1" style="margin-bottom: 4px; ">保留的 iOS InfoAdditions 设置</span></a></p></li><li style="margin-bottom: 4px; margin-left: 18px; list-style: inherit !important; "><p style="margin-bottom: 4px; "><a href="http://help.adobe.com/zh_CN/air/build/WSfffb011ac560372f7e64a7f12cd2dd1867-8000.html#WS901d38e593cd1bac-3cb3c27712e2339d6cd-8000" style="text-decoration: none; color: rgb(0, 125, 216); margin-bottom: 4px; "><span class="topictitle1" style="margin-bottom: 4px; ">支持不同的 iOS 设备型号</span></a></p></li><li style="margin-bottom: 4px; margin-left: 18px; list-style: inherit !important; "><p style="margin-bottom: 4px; "><a href="http://help.adobe.com/zh_CN/air/build/WSfffb011ac560372f7e64a7f12cd2dd1867-8000.html#WS901d38e593cd1bac-3cb3c27712e2339d6cd-7fff" style="text-decoration: none; color: rgb(0, 125, 216); margin-bottom: 4px; "><span class="topictitle1" style="margin-bottom: 4px; ">高分辨率显示器</span></a></p></li><li style="margin-bottom: 4px; margin-left: 18px; list-style: inherit !important; "><p style="margin-bottom: 4px; "><a href="http://help.adobe.com/zh_CN/air/build/WSfffb011ac560372f7e64a7f12cd2dd1867-8000.html#WS901d38e593cd1bac354f4f7b12e260e3e67-8000" style="text-decoration: none; color: rgb(0, 125, 216); margin-bottom: 4px; "><span class="topictitle1" style="margin-bottom: 4px; ">iOS 自定义 URI 方案</span></a></p></li><li style="margin-bottom: 4px; margin-left: 18px; list-style: inherit !important; "><p style="margin-bottom: 4px; "><a href="http://help.adobe.com/zh_CN/air/build/WSfffb011ac560372f7e64a7f12cd2dd1867-8000.html#WS901d38e593cd1bac75e7c78e12e258a50a8-8000" style="text-decoration: none; color: rgb(0, 125, 216); margin-bottom: 4px; "><span class="topictitle1" style="margin-bottom: 4px; ">iOS 兼容性筛选</span></a></p></li><li style="margin-bottom: 4px; margin-left: 18px; list-style: inherit !important; "><p style="margin-bottom: 4px; "><a href="http://help.adobe.com/zh_CN/air/build/WSfffb011ac560372f7e64a7f12cd2dd1867-8000.html#WS901d38e593cd1bac1dc3127e12e25ae562d-8000" style="text-decoration: none; color: rgb(0, 125, 216); margin-bottom: 4px; "><span class="topictitle1" style="margin-bottom: 4px; ">退出而不是暂停</span></a></p></li><li style="margin-bottom: 4px; margin-left: 18px; list-style: inherit !important; "><p style="margin-bottom: 4px; "><a href="http://help.adobe.com/zh_CN/air/build/WSfffb011ac560372f7e64a7f12cd2dd1867-8000.html#WS180fc5cb46642d107f85760613d88823106-8000" style="text-decoration: none; color: rgb(0, 125, 216); margin-bottom: 4px; "><span class="topictitle1" style="margin-bottom: 4px; ">通过加载仅包含资源的外部 SWF 将下载大小降至最低</span></a></p></li><li style="margin-bottom: 4px; margin-left: 18px; list-style: inherit !important; "><p style="margin-bottom: 4px; "><a href="http://help.adobe.com/zh_CN/air/build/WSfffb011ac560372f7e64a7f12cd2dd1867-8000.html#WS2EEDB396-2CB9-49f3-8631-81E8EE711FCE" style="text-decoration: none; color: rgb(0, 125, 216); margin-bottom: 4px; "><span class="topictitle1" style="margin-bottom: 4px; ">Geolocation 支持</span></a></p></li></ul></div></div></div></div><div><p style="margin-bottom: 8px; ">仅应用于 iOS 设备的设置会被放置到应用程序描述符的&nbsp;<samp class="codeph" style="font-family: Verdana, Arial, Helvetica, sans-serif, SimSun-18030; ">&lt;iPhone&gt;</samp>&nbsp;元素中。<samp class="codeph" style="font-family: Verdana, Arial, Helvetica, sans-serif, SimSun-18030; ">iPhone</samp>&nbsp;元素可以具有&nbsp;<samp class="codeph" style="font-family: Verdana, Arial, Helvetica, sans-serif, SimSun-18030; ">InfoAdditions</samp>、<samp class="codeph" style="font-family: Verdana, Arial, Helvetica, sans-serif, SimSun-18030; ">requestedDisplayResolution</samp>、<samp class="codeph" style="font-family: Verdana, Arial, Helvetica, sans-serif, SimSun-18030; ">Entitlements</samp>、<samp class="codeph" style="font-family: Verdana, Arial, Helvetica, sans-serif, SimSun-18030; ">externalSwfs</samp>&nbsp;以及&nbsp;<samp class="codeph" style="font-family: Verdana, Arial, Helvetica, sans-serif, SimSun-18030; ">forceCPURenderModeForDevices</samp>&nbsp;这些子元素。</p><div class="para">利用&nbsp;<samp class="codeph" style="font-family: Verdana, Arial, Helvetica, sans-serif, SimSun-18030; ">InfoAdditions</samp>&nbsp;元素,您可以指定要添加到应用程序的 Info.plist 设置文件的键值对。例如,下面这些值设置应用程序的状态栏样式,并声明应用程序不要求永久的 Wi-Fi 访问。<pre style="font-family: Verdana, Arial, Helvetica, sans-serif, SimSun-18030; margin: 12px 10px; padding: 12px 10px 16px; background-color: rgb(240, 247, 254); border: 1px solid rgb(204, 204, 204); overflow-x: auto; color: rgb(51, 51, 51); ">&lt;InfoAdditions&gt;
    &lt;![CDATA[
      &lt;key&gt;UIStatusBarStyle&lt;/key&gt;
      &lt;string&gt;UIStatusBarStyleBlackOpaque&lt;/string&gt;
      &lt;key&gt;UIRequiresPersistentWiFi&lt;/key&gt;
      &lt;string&gt;NO&lt;/string&gt;
    ]]&gt;
&lt;/InfoAdditions&gt;</pre></div><p style="margin-bottom: 8px; ">InfoAdditions 设置括在&nbsp;<samp class="codeph" style="font-family: Verdana, Arial, Helvetica, sans-serif, SimSun-18030; ">CDATA</samp>&nbsp;标记中。</p><p style="margin-bottom: 8px; ">利用&nbsp;<samp class="codeph" style="font-family: Verdana, Arial, Helvetica, sans-serif, SimSun-18030; ">Entitlements</samp>&nbsp;元素,您可以指定要添加到应用程序的 Entitlements.plist 设置文件的键值对。Entitlements.plist 设置使应用程序能够访问某些 iOS 功能,例如推送通知。</p><p style="margin-bottom: 8px; ">有关 Info.plist 和 Entitlements.plist 设置的更多详细信息,请参阅 Apple 开发人员文档。</p></div><div id="WSd6d4f896b3a8801b-15a1d5f91370ecb9970-8000" class="nochunk"><a name="WSd6d4f896b3a8801b-15a1d5f91370ecb9970-8000"></a><h2 class="topictitle2" style="font-size: 19px; line-height: 28px; margin-top: 24px; margin-bottom: 10px; ">支持 iOS 上的后台任务</h2><div><p style="margin-bottom: 8px; ">Adobe AIR 3.3 和更高版本通过启用某些后台行为在 iOS 上支持多任务处理:</p><ul style="margin-right: 10px; margin-left: 10px; list-style: square; "><li style="margin-bottom: 6px; margin-left: 18px; list-style: inherit; "><p style="margin-bottom: 3px; ">音频</p></li><li style="margin-bottom: 6px; margin-left: 18px; list-style: inherit; "><p style="margin-bottom: 3px; ">位置更新</p></li><li style="margin-bottom: 6px; margin-left: 18px; list-style: inherit; "><p style="margin-bottom: 3px; ">网络</p></li><li style="margin-bottom: 6px; margin-left: 18px; list-style: inherit; "><p style="margin-bottom: 3px; ">选择禁止后台执行应用程序</p></li></ul><div class="note" style="margin-top: 10px; margin-bottom: 10px; "><span class="notetitle" style="font-weight: bold; ">注:&nbsp;</span>对于 SWF 21 及其之前的版本,当渲染模式设置为“direct”时,AIR 在 iOS 和 Android 上不支持后台执行。由于这一限制,基于 Stage3D 的应用程序无法执行如音频播放、位置更新、网络上传或下载等后台任务。iOS 不允许在后台进行 OpenGLES 或渲染调用。试图在后台进行 OpenGL 调用的应用程序会被 iOS 终止。Android 并不限制应用程序在后台进行 OpenGLES 调用或执行其他后台任务(如音频播放)。对于 SWF 22 及其之后的版本,当 renderMode 设置为“direct”时,AIR 移动设备应用程序可以在后台执行。如果是在后台进行 OpenGLES 调用,则 AIR iOS 运行时会导致 ActionScript 错误(3768 - 不可以在后台执行期间使用 Stage3D API)。不过,在 Android 上不会导致错误,原因是允许其本机应用程序在后台进行 OpenGLES 调用。若想对移动设备资源的利用达到最佳效果,当应用程序在后台执行时,不要进行渲染调用。</div><div class="section"><h4 class="sectiontitle" style="margin-top: 12px; margin-bottom: 4px; ">后台音频</h4><p style="margin-bottom: 8px; ">若要启用后台音频播放和录制,请在&nbsp;<samp class="codeph" style="font-family: Verdana, Arial, Helvetica, sans-serif, SimSun-18030; ">InfoAdditions</samp>&nbsp;元素中包括以下键值对:</p><pre style="font-family: Verdana, Arial, Helvetica, sans-serif, SimSun-18030; margin: 12px 10px; padding: 12px 10px 16px; background-color: rgb(240, 247, 254); border: 1px solid rgb(204, 204, 204); overflow-x: auto; color: rgb(51, 51, 51); ">&lt;InfoAdditions&gt;
    &lt;![CDATA[
       &lt;key&gt;UIBackgroundModes&lt;/key&gt;
         &lt;array&gt;
               &lt;string&gt;audio&lt;/string&gt;
            &lt;/array&gt;
    ]]&gt;
&lt;/InfoAdditions&gt;</pre></div><div class="section"><h4 class="sectiontitle" style="margin-top: 12px; margin-bottom: 4px; ">后台位置更新</h4><p style="margin-bottom: 8px; ">若要启用后台位置更新,请在&nbsp;<samp class="codeph" style="font-family: Verdana, Arial, Helvetica, sans-serif, SimSun-18030; ">InfoAdditions</samp>&nbsp;元素中包括以下键值对:</p><pre style="font-family: Verdana, Arial, Helvetica, sans-serif, SimSun-18030; margin: 12px 10px; padding: 12px 10px 16px; background-color: rgb(240, 247, 254); border: 1px solid rgb(204, 204, 204); overflow-x: auto; color: rgb(51, 51, 51); ">&lt;InfoAdditions&gt;
    &lt;![CDATA[
      &lt;key&gt;UIBackgroundModes&lt;/key&gt;
      &lt;array&gt;
               &lt;string&gt;location&lt;/string&gt;
         &lt;/array&gt;
    ]]&gt;
&lt;/InfoAdditions&gt;</pre><div class="note" style="margin-top: 10px; margin-bottom: 10px; "><span class="notetitle" style="font-weight: bold; ">注:&nbsp;</span>仅在必要时使用此功能,因为位置 API 会大量消耗电池电量。</div></div><div class="section"><h4 class="sectiontitle" style="margin-top: 12px; margin-bottom: 4px; ">后台网络</h4><p style="margin-bottom: 8px; ">为了在后台执行简短任务,您的应用程序会将&nbsp;<samp class="codeph" style="font-family: Verdana, Arial, Helvetica, sans-serif, SimSun-18030; ">NativeApplication.nativeApplication.executeInBackground</samp>&nbsp;属性设置为&nbsp;<samp class="codeph" style="font-family: Verdana, Arial, Helvetica, sans-serif, SimSun-18030; ">true</samp>。</p><p style="margin-bottom: 8px; ">例如,您的应用程序可能会启动文件上载操作,此后用户将另一个应用程序移动到前台。当应用程序收到上载完成事件时,它可以将&nbsp;<samp class="codeph" style="font-family: Verdana, Arial, Helvetica, sans-serif, SimSun-18030; ">NativeApplication.nativeApplication.executeInBackground</samp>&nbsp;设置为&nbsp;<samp class="codeph" style="font-family: Verdana, Arial, Helvetica, sans-serif, SimSun-18030; ">false</samp>。</p><p style="margin-bottom: 8px; ">将&nbsp;<samp class="codeph" style="font-family: Verdana, Arial, Helvetica, sans-serif, SimSun-18030; ">NativeApplication.nativeApplication.executeInBackground</samp>&nbsp;属性设置为&nbsp;<samp class="codeph" style="font-family: Verdana, Arial, Helvetica, sans-serif, SimSun-18030; ">true</samp>&nbsp;不能保证应用程序将无限期运行,因为 iOS 会对后台任务施加时间限制。当 iOS 停止后台处理时,AIR 将调度&nbsp;<samp class="codeph" style="font-family: Verdana, Arial, Helvetica, sans-serif, SimSun-18030; ">NativeApplication.suspend</samp>&nbsp;事件。</p></div><div class="section"><h4 class="sectiontitle" style="margin-top: 12px; margin-bottom: 4px; ">选择禁止后台执行</h4><p style="margin-bottom: 8px; ">您的应用程序可以通过在&nbsp;<samp class="codeph" style="font-family: Verdana, Arial, Helvetica, sans-serif, SimSun-18030; ">InfoAdditions</samp>&nbsp;元素中包括以下键值对,明确选择禁止后台执行:</p><pre style="font-family: Verdana, Arial, Helvetica, sans-serif, SimSun-18030; margin: 12px 10px; padding: 12px 10px 16px; background-color: rgb(240, 247, 254); border: 1px solid rgb(204, 204, 204); overflow-x: auto; color: rgb(51, 51, 51); ">&lt;InfoAdditions&gt;
    &lt;![CDATA[
       &lt;key&gt;UIApplicationExitsOnSuspend&lt;/key&gt;
       &lt;true/&gt;
    ]]&gt;
&lt;/InfoAdditions&gt;</pre></div></div></div><div id="WS901d38e593cd1bac6c9d409a12e26b451be-8000" class="nochunk"><a name="WS901d38e593cd1bac6c9d409a12e26b451be-8000"></a><h2 class="topictitle2" style="font-size: 19px; line-height: 28px; margin-top: 24px; margin-bottom: 10px; ">保留的 iOS InfoAdditions 设置</h2><div><p style="margin-bottom: 8px; ">AIR 会在生成的 Info.plist 文件中设置多个条目,以确保应用程序和运行时功能正确运行。您不能定义以下设置:</p><div class="tablenoborder"><table border="1" cellpadding="4" cellspacing="0" style="border-spacing: 0px; margin-top: 10px; margin-bottom: 12px; "><tbody><tr><td valign="top" width="NaN%" style="margin-left: 2px; padding: 8px 8px 1px; vertical-align: top; "><p style="margin-bottom: 8px; ">CFBundleDisplayName</p><p style="margin-bottom: 8px; ">CFBundleExecutable</p><p style="margin-bottom: 8px; ">CFBundleIconFiles</p><p style="margin-bottom: 8px; ">CFBundleIdentifier</p><p style="margin-bottom: 8px; ">CFBundleInfoDictionaryVersion</p><p style="margin-bottom: 8px; ">CFBundlePackageType</p><p style="margin-bottom: 8px; ">CFBundleResourceSpecification</p><p style="margin-bottom: 8px; ">CFBundleShortVersionString</p><p style="margin-bottom: 8px; ">CFBundleSupportedPlatforms</p><p style="margin-bottom: 8px; ">CFBundleVersion</p><p style="margin-bottom: 8px; ">CTAutoOrients</p></td><td valign="top" width="NaN%" style="margin-left: 2px; padding: 8px 8px 1px; vertical-align: top; "><p style="margin-bottom: 8px; ">CTInitialWindowTitle</p><p style="margin-bottom: 8px; ">CTInitialWindowVisible</p><p style="margin-bottom: 8px; ">CTIosSdkVersion</p><p style="margin-bottom: 8px; ">CTMaxSWFMajorVersion</p><p style="margin-bottom: 8px; ">DTPlatformName</p><p style="margin-bottom: 8px; ">DTSDKName</p><p style="margin-bottom: 8px; ">MinimumOSVersion(保留到 3.2)</p><p style="margin-bottom: 8px; ">NSMainNibFile</p><p style="margin-bottom: 8px; ">UIInterfaceOrientation</p><p style="margin-bottom: 8px; ">UIStatusBarHidden</p><p style="margin-bottom: 8px; ">UISupportedInterfaceOrientations</p></td></tr></tbody></table></div><div class="note" style="margin-top: 10px; margin-bottom: 10px; "><span class="notetitle" style="font-weight: bold; ">注:&nbsp;</span>您可以定义 MinimumOSVersion。MinimumOSVersion 定义在 Air 3.3 和更高版本中提供。</div></div></div><div id="WS901d38e593cd1bac-3cb3c27712e2339d6cd-8000" class="nochunk"><a name="WS901d38e593cd1bac-3cb3c27712e2339d6cd-8000"></a><h2 class="topictitle2" style="font-size: 19px; line-height: 28px; margin-top: 24px; margin-bottom: 10px; ">支持不同的 iOS 设备型号</h2><div><p style="margin-bottom: 8px; ">为了支持 iPad,请为&nbsp;<samp class="codeph" style="font-family: Verdana, Arial, Helvetica, sans-serif, SimSun-18030; ">InfoAdditions</samp>&nbsp;元素中的&nbsp;<samp class="codeph" style="font-family: Verdana, Arial, Helvetica, sans-serif, SimSun-18030; ">UIDeviceFamily</samp>&nbsp;添加正确的键值设置。<samp class="codeph" style="font-family: Verdana, Arial, Helvetica, sans-serif, SimSun-18030; ">UIDeviceFamily</samp>&nbsp;设置是一个字符串数组。每个字符串都定义受支持的设备。<samp class="codeph" style="font-family: Verdana, Arial, Helvetica, sans-serif, SimSun-18030; ">&lt;string&gt;1&lt;/string&gt;</samp>&nbsp;设置定义对 iPhone 和 iPod Touch 的支持。<samp class="codeph" style="font-family: Verdana, Arial, Helvetica, sans-serif, SimSun-18030; ">&lt;string&gt;2&lt;/string&gt;</samp>&nbsp;设置定义对 iPad 的支持。如果仅指定其中一个字符串,则仅支持该设备系列。例如,下面的设置限制对 iPad 的支持:</p><pre style="font-family: Verdana, Arial, Helvetica, sans-serif, SimSun-18030; margin: 12px 10px; padding: 12px 10px 16px; background-color: rgb(240, 247, 254); border: 1px solid rgb(204, 204, 204); overflow-x: auto; color: rgb(51, 51, 51); ">&lt;key&gt;UIDeviceFamily&lt;/key&gt;
    &lt;array&gt;
      &lt;string&gt;2&lt;/string&gt;
    &lt;/array&gt;&gt;</pre><p style="margin-bottom: 8px; ">下面的设置支持两个设备系列(iPhone/iPod Touch 和 iPad):</p><pre style="font-family: Verdana, Arial, Helvetica, sans-serif, SimSun-18030; margin: 12px 10px; padding: 12px 10px 16px; background-color: rgb(240, 247, 254); border: 1px solid rgb(204, 204, 204); overflow-x: auto; color: rgb(51, 51, 51); ">&lt;key&gt;UIDeviceFamily&lt;/key&gt;
&lt;array&gt;
    &lt;string&gt;1&lt;/string&gt;
    &lt;string&gt;2&lt;/string&gt;
&lt;/array&gt;</pre><p style="margin-bottom: 8px; ">另外,在 AIR 3.7 和更高版本中,您可以使用&nbsp;<samp class="codeph" style="font-family: Verdana, Arial, Helvetica, sans-serif, SimSun-18030; ">forceCPURenderModeForDevices</samp>&nbsp;标记对指定系列的设备强制启用 CPU 渲染模式,而对剩余的 iOS 设备启用 GPU 渲染模式。</p><p style="margin-bottom: 8px; ">您应将其作为&nbsp;<samp class="codeph" style="font-family: Verdana, Arial, Helvetica, sans-serif, SimSun-18030; ">iPhone</samp>&nbsp;标记的子标记来添加,并指定设备型号名称,各名称之间以空格分隔。有关有效设备型号名称的列表,请参阅&nbsp;<a href="http://help.adobe.com/zh_CN/air/build/WS180fc5cb46642d10-3a65697f13da2342af2-8000.html" style="text-decoration: none; color: rgb(0, 125, 216); ">forceCPURenderModeForDevices</a>。</p><p style="margin-bottom: 8px; ">例如,若想在老式的 iPod、iPhone 及 iPad 中使用 CPU 模式,而对所有其他设备启用 GPU 模式,则可在应用程序描述符中指定以下内容:</p><pre style="font-family: Verdana, Arial, Helvetica, sans-serif, SimSun-18030; margin: 12px 10px; padding: 12px 10px 16px; background-color: rgb(240, 247, 254); border: 1px solid rgb(204, 204, 204); overflow-x: auto; color: rgb(51, 51, 51); ">...
&lt;renderMode&gt;GPU&lt;/renderMode&gt;
...
&lt;iPhone&gt;
...
&nbsp;&nbsp;&nbsp;&lt;forceCPURenderModeForDevices&gt;iPad1,1 iPhone1,1 iPhone1,2 iPod1,1
&nbsp;&nbsp;&nbsp;&lt;/forceCPURenderModeForDevices&gt;
&lt;/iPhone&gt;</pre></div></div><div id="WS901d38e593cd1bac-3cb3c27712e2339d6cd-7fff" class="nochunk"><a name="WS901d38e593cd1bac-3cb3c27712e2339d6cd-7fff"></a><h2 class="topictitle2" style="font-size: 19px; line-height: 28px; margin-top: 24px; margin-bottom: 10px; ">高分辨率显示器</h2><div><p style="margin-bottom: 8px; ">利用&nbsp;<samp class="codeph" style="font-family: Verdana, Arial, Helvetica, sans-serif, SimSun-18030; ">requestedDisplayResolution</samp>&nbsp;元素,可以指定在具有高分辨率屏幕的 iOS 设备上,应用程序是应该使用&nbsp;<i xmlns:fn="http://www.w3.org/2005/xpath-functions" xmlns:fo="http://www.w3.org/1999/XSL/Format" xmlns:xs="http://www.w3.org/2001/XMLSchema" style="font-style: normal; ">standard</i>&nbsp;分辨率模式还是应该使用&nbsp;<i xmlns:fn="http://www.w3.org/2005/xpath-functions" xmlns:fo="http://www.w3.org/1999/XSL/Format" xmlns:xs="http://www.w3.org/2001/XMLSchema" style="font-style: normal; ">high</i>&nbsp;分辨率模式。</p><pre style="font-family: Verdana, Arial, Helvetica, sans-serif, SimSun-18030; margin: 12px 10px; padding: 12px 10px 16px; background-color: rgb(240, 247, 254); border: 1px solid rgb(204, 204, 204); overflow-x: auto; color: rgb(51, 51, 51); ">&lt;requestedDisplayResolution&gt;high&lt;/requestedDisplayResolution&gt;</pre><p style="margin-bottom: 8px; ">在高分辨率模式中,您可以在高分辨率显示屏上逐个处理每个像素。在标准模式中,设备屏幕将以标准分辨率显示应用程序。在该模式中绘制单个像素会在高分辨率屏幕上设置四个像素的颜色。</p><p style="margin-bottom: 8px; ">默认设置为&nbsp;<samp class="codeph" style="font-family: Verdana, Arial, Helvetica, sans-serif, SimSun-18030; ">standard</samp>。请注意,如果目标设备是 iOS 设备,则应使用&nbsp;<samp class="codeph" style="font-family: Verdana, Arial, Helvetica, sans-serif, SimSun-18030; ">requestedDisplayResolution</samp>&nbsp;元素作为&nbsp;<samp class="codeph" style="font-family: Verdana, Arial, Helvetica, sans-serif, SimSun-18030; ">iPhone</samp>&nbsp;元素(并非&nbsp;<samp class="codeph" style="font-family: Verdana, Arial, Helvetica, sans-serif, SimSun-18030; ">InfoAdditions</samp>&nbsp;元素或&nbsp;<samp class="codeph" style="font-family: Verdana, Arial, Helvetica, sans-serif, SimSun-18030; ">initialWindow</samp>&nbsp;元素)的子元素。</p><p style="margin-bottom: 8px; ">如果想在不同的设备上使用不同的设置,可将您的默认值指定为&nbsp;<samp class="codeph" style="font-family: Verdana, Arial, Helvetica, sans-serif, SimSun-18030; ">requestedDisplayResolution</samp>&nbsp;元素的值。使用&nbsp;<samp class="codeph" style="font-family: Verdana, Arial, Helvetica, sans-serif, SimSun-18030; ">excludeDevices</samp>&nbsp;属性可指定应使用相反值的设备。例如,使用以下代码,将对所有支持高分辨率模式的设备使用这一模式,第三代 iPad 除外,它使用标准分辨率模式:</p><pre style="font-family: Verdana, Arial, Helvetica, sans-serif, SimSun-18030; margin: 12px 10px; padding: 12px 10px 16px; background-color: rgb(240, 247, 254); border: 1px solid rgb(204, 204, 204); overflow-x: auto; color: rgb(51, 51, 51); ">&lt;requestedDisplayResolution excludeDevices="iPad3"&gt;high&lt;/requestedDisplayResolution&gt;</pre><p style="margin-bottom: 8px; "><samp class="codeph" style="font-family: Verdana, Arial, Helvetica, sans-serif, SimSun-18030; ">excludeDevices</samp>&nbsp;属性可用在 AIR 3.6 和更高版本中。</p></div></div><div id="WS901d38e593cd1bac354f4f7b12e260e3e67-8000" class="nochunk"><a name="WS901d38e593cd1bac354f4f7b12e260e3e67-8000"></a><h2 class="topictitle2" style="font-size: 19px; line-height: 28px; margin-top: 24px; margin-bottom: 10px; ">iOS 自定义 URI 方案</h2><div><p style="margin-bottom: 8px; ">您可以注册自定义 URI 方案,以便允许您的应用程序由网页中的链接或设备上的其他本机应用程序进行调用。若要注册 URI 方案,请将 CFBundleURLTypes 键添加到 InfoAdditions 元素中。下面的示例注册了一个名为&nbsp;<i xmlns:fn="http://www.w3.org/2005/xpath-functions" xmlns:fo="http://www.w3.org/1999/XSL/Format" xmlns:xs="http://www.w3.org/2001/XMLSchema" style="font-style: normal; ">com.example.app</i>&nbsp;的 URI 方案,从而允许应用程序由<i xmlns:fn="http://www.w3.org/2005/xpath-functions" xmlns:fo="http://www.w3.org/1999/XSL/Format" xmlns:xs="http://www.w3.org/2001/XMLSchema" style="font-style: normal; ">example://foo</i>&nbsp;形式的 URL 进行调用。</p><pre style="font-family: Verdana, Arial, Helvetica, sans-serif, SimSun-18030; margin: 12px 10px; padding: 12px 10px 16px; background-color: rgb(240, 247, 254); border: 1px solid rgb(204, 204, 204); overflow-x: auto; color: rgb(51, 51, 51); ">&lt;key&gt;CFBundleURLTypes&lt;/key&gt;
&lt;array&gt;
    &lt;dict&gt;
         &lt;key&gt;CFBundleURLSchemes&lt;/key&gt;
      &lt;array&gt;
            &lt;string&gt;example&lt;/string&gt;
      &lt;/array&gt;
      &lt;key&gt;CFBundleURLName&lt;/key&gt;
      &lt;string&gt;com.example.app&lt;/string&gt;
    &lt;/dict&gt;
&lt;/array&gt;</pre><p style="margin-bottom: 8px; ">通过自定义 URI 调用应用程序时,NativeApplication 对象会调度一个&nbsp;<samp class="codeph" style="font-family: Verdana, Arial, Helvetica, sans-serif, SimSun-18030; ">invoke</samp>&nbsp;事件。此链接的 URL(包括查询参数)放在 InvokeEvent 对象的&nbsp;<samp class="codeph" style="font-family: Verdana, Arial, Helvetica, sans-serif, SimSun-18030; ">arguments</samp>&nbsp;数组中。您可以使用任意多个自定义 URI 方案。</p><div class="note" style="margin-top: 10px; margin-bottom: 10px; "><span class="notetitle" style="font-weight: bold; ">注:&nbsp;</span>StageWebView 实例中的链接无法打开使用自定义 URI 方案的 URL。</div><div class="note" style="margin-top: 10px; margin-bottom: 10px; "><span class="notetitle" style="font-weight: bold; ">注:&nbsp;</span>如果另一个应用程序已注册某个方案,则您的应用程序不能将其替换成为该 URI 方案注册的应用程序。</div></div></div><div id="WS901d38e593cd1bac75e7c78e12e258a50a8-8000" class="nochunk"><a name="WS901d38e593cd1bac75e7c78e12e258a50a8-8000"></a><h2 class="topictitle2" style="font-size: 19px; line-height: 28px; margin-top: 24px; margin-bottom: 10px; ">iOS 兼容性筛选</h2><div><p style="margin-bottom: 8px; ">如果您的应用程序只能在具有特定硬件或软件功能的设备上使用,则请将条目添加到&nbsp;<samp class="codeph" style="font-family: Verdana, Arial, Helvetica, sans-serif, SimSun-18030; ">InfoAdditions</samp>&nbsp;元素的 UIRequiredDeviceCapabilities 数组中。例如,以下条目表示应用程序需要静态摄像头和麦克风:</p><pre style="font-family: Verdana, Arial, Helvetica, sans-serif, SimSun-18030; margin: 12px 10px; padding: 12px 10px 16px; background-color: rgb(240, 247, 254); border: 1px solid rgb(204, 204, 204); overflow-x: auto; color: rgb(51, 51, 51); ">&lt;key&gt;UIRequiredDeviceCapabilities&lt;/key&gt;
&lt;array&gt;
    &lt;string&gt;microphone&lt;/string&gt;
    &lt;string&gt;still-camera&lt;/string&gt;
&lt;/array&gt;</pre><p style="margin-bottom: 8px; ">如果设备缺少相应的功能,则无法安装该应用程序。与 AIR 应用程序相关的功能设置包括:</p><div class="tablenoborder"><table border="1" cellpadding="4" cellspacing="0" style="border-spacing: 0px; margin-top: 10px; margin-bottom: 12px; "><tbody><tr><td valign="top" width="NaN%" style="margin-left: 2px; padding: 8px 8px 1px; vertical-align: top; "><p style="margin-bottom: 8px; ">telephony</p><p style="margin-bottom: 8px; ">wifi</p><p style="margin-bottom: 8px; ">sms</p><p style="margin-bottom: 8px; ">still-camera</p><p style="margin-bottom: 8px; ">auto-focus-camera</p><p style="margin-bottom: 8px; ">front-facing-camera</p></td><td valign="top" width="NaN%" style="margin-left: 2px; padding: 8px 8px 1px; vertical-align: top; "><p style="margin-bottom: 8px; ">camera-flash</p><p style="margin-bottom: 8px; ">video-camera</p><p style="margin-bottom: 8px; ">accelerometer</p><p style="margin-bottom: 8px; ">location-services</p><p style="margin-bottom: 8px; ">gps</p><p style="margin-bottom: 8px; ">microphone</p></td></tr></tbody></table></div><p style="margin-bottom: 8px; ">AIR 2.6 以上的版本自动将&nbsp;<i xmlns:fn="http://www.w3.org/2005/xpath-functions" xmlns:fo="http://www.w3.org/1999/XSL/Format" xmlns:xs="http://www.w3.org/2001/XMLSchema" style="font-style: normal; ">armv7</i>&nbsp;和&nbsp;<i xmlns:fn="http://www.w3.org/2005/xpath-functions" xmlns:fo="http://www.w3.org/1999/XSL/Format" xmlns:xs="http://www.w3.org/2001/XMLSchema" style="font-style: normal; ">opengles-2</i>&nbsp;添加到必需功能的列表中。</p><div class="note" style="margin-top: 10px; margin-bottom: 10px; "><span class="notetitle" style="font-weight: bold; ">注:&nbsp;</span>您无需为了让应用程序使用这些功能而将其添加到应用程序描述符中。仅需使用 UIRequiredDeviceCapabilities 设置即可阻止用户在无法正常使用的设备上安装应用程序。</div></div></div><div id="WS901d38e593cd1bac1dc3127e12e25ae562d-8000" class="nochunk"><a name="WS901d38e593cd1bac1dc3127e12e25ae562d-8000"></a><h2 class="topictitle2" style="font-size: 19px; line-height: 28px; margin-top: 24px; margin-bottom: 10px; ">退出而不是暂停</h2><div><p style="margin-bottom: 8px; ">如果用户离开 AIR 应用程序,该应用程序会进入后台并暂停。如果要让应用程序彻底退出而不是暂停,请将&nbsp;<samp class="codeph" style="font-family: Verdana, Arial, Helvetica, sans-serif, SimSun-18030; ">UIApplicationExitsOnSuspend</samp>&nbsp;属性设置为&nbsp;<samp class="codeph" style="font-family: Verdana, Arial, Helvetica, sans-serif, SimSun-18030; ">YES</samp>:</p><pre style="font-family: Verdana, Arial, Helvetica, sans-serif, SimSun-18030; margin: 12px 10px; padding: 12px 10px 16px; background-color: rgb(240, 247, 254); border: 1px solid rgb(204, 204, 204); overflow-x: auto; color: rgb(51, 51, 51); ">&lt;key&gt;UIApplicationExitsOnSuspend&lt;/key&gt;
&lt;true/&gt;</pre></div></div><div id="WS180fc5cb46642d107f85760613d88823106-8000" class="nochunk"><a name="WS180fc5cb46642d107f85760613d88823106-8000"></a><h2 class="topictitle2" style="font-size: 19px; line-height: 28px; margin-top: 24px; margin-bottom: 10px; ">通过加载仅包含资源的外部 SWF 将下载大小降至最低</h2><div><p style="margin-bottom: 8px; ">若想将初始应用程序下载大小降至最低,您可以对应用程序所使用的 SWF 子集进行打包,并在运行时使用&nbsp;<samp class="codeph" style="font-family: Verdana, Arial, Helvetica, sans-serif, SimSun-18030; ">Loader.load()</samp>&nbsp;方法加载剩余的(仅包含资源)外部 SWF。要使用此功能,您在打包应用程序时,必须让 ADT 将所有 ActionScript 字节码 (ABC) 从外部加载的 SWF 文件移动到主应用程序 SWF,留下只包含资源的 SWF 文件。这是为了遵守 Apple Store 禁止在安装应用程序之后再下载任何代码的这一规则。</p><p style="margin-bottom: 8px; ">ADT 会通过以下操作来支持外部加载的 SWF(也称为去除代码的 SWF):</p><ul style="margin-right: 10px; margin-left: 10px; list-style: square; "><li style="margin-bottom: 6px; margin-left: 18px; list-style: inherit; "><p style="margin-bottom: 3px; ">读取&nbsp;<samp class="codeph" style="font-family: Verdana, Arial, Helvetica, sans-serif, SimSun-18030; ">&lt;iPhone&gt;</samp>&nbsp;元素的&nbsp;<samp class="codeph" style="font-family: Verdana, Arial, Helvetica, sans-serif, SimSun-18030; ">&lt;externalSwfs&gt;</samp>&nbsp;子元素中指定的文本文件,以访问要在执行时加载的 SWF(它是一个行分隔列表):</p><pre style="font-family: Verdana, Arial, Helvetica, sans-serif, SimSun-18030; margin: 12px 10px; padding: 12px 10px 16px; background-color: rgb(240, 247, 254); border: 1px solid rgb(204, 204, 204); overflow-x: auto; color: rgb(51, 51, 51); ">&lt;iPhone&gt;
&nbsp;&nbsp;&nbsp;...
&nbsp;&nbsp;&nbsp;&lt;externalSwfs&gt;FilewithPathsOfSWFsThatAreToNotToBePackaged.txt&lt;/externalSwfs&gt;
&lt;/iPhone&gt;</pre></li><li style="margin-bottom: 6px; margin-left: 18px; list-style: inherit; "><p style="margin-bottom: 3px; ">将 ABC 码从每个外部加载的 SWF 中转移到主执行程序。</p></li><li style="margin-bottom: 6px; margin-left: 18px; list-style: inherit; "><p style="margin-bottom: 3px; ">忽略掉 .ipa 文件中的外部加载 SWF。</p></li><li style="margin-bottom: 6px; margin-left: 18px; list-style: inherit; "><p style="margin-bottom: 3px; ">将去除代码的 SWF 复制到&nbsp;<samp class="codeph" style="font-family: Verdana, Arial, Helvetica, sans-serif, SimSun-18030; ">.remoteStrippedSWFs</samp>&nbsp;目录。您将这些 SWF 通过一个 Web 服务器来托管,并让您的应用程序必要时在运行时加载它们。</p></li></ul><p style="margin-bottom: 8px; ">您指出要在运行时加载的 SWF 文件,方法是在一个文本文件中指定它们的名称(每行一个),如下例所示:</p><pre style="font-family: Verdana, Arial, Helvetica, sans-serif, SimSun-18030; margin: 12px 10px; padding: 12px 10px 16px; background-color: rgb(240, 247, 254); border: 1px solid rgb(204, 204, 204); overflow-x: auto; color: rgb(51, 51, 51); ">assets/Level1/Level1.swf
assets/Level2/Level2.swf
assets/Level3/Level3.swf
assets/Level4/Level4.swf</pre><p style="margin-bottom: 8px; ">指定的文件路径相对于应用程序描述符文件。另外,您必须在&nbsp;<samp class="codeph" style="font-family: Verdana, Arial, Helvetica, sans-serif, SimSun-18030; ">adt</samp>&nbsp;命令中将这些 swf 指定为资源。</p><div class="note" style="margin-top: 10px; margin-bottom: 10px; "><span class="notetitle" style="font-weight: bold; ">注:&nbsp;</span>此功能仅适用于标准打包。对于快速打包(例如,使用解释器、模拟器或调试),ADT 并不创建去除代码的 SWF。</div><p class="byline" style="margin-bottom: 8px; "><img src="http://help.adobe.com/zh_CN/air/build/images/byline.png" style="border: 0px; vertical-align: -20%; ">&nbsp;有关此功能的更多信息,包括示例代码,请参阅 Adobe 工程师 Abhinav Dhandh 撰写的一篇博客文章:<a href="http://blogs.adobe.com/airodynamics/2013/03/08/external-hosting-of-secondary-swfs-for-air-apps-on-ios/" target="_self" style="text-decoration: none; color: rgb(0, 125, 216); ">对用于 iOS 上的 AIR 应用程序的二级 SWF 实现外部托管</a></p></div></div><div id="WS2EEDB396-2CB9-49f3-8631-81E8EE711FCE" class="nochunk"><a name="WS2EEDB396-2CB9-49f3-8631-81E8EE711FCE"></a><h2 class="topictitle2" style="font-size: 19px; line-height: 28px; margin-top: 24px; margin-bottom: 10px; ">Geolocation 支持</h2><div><p style="margin-bottom: 8px; ">为实现 Geolocation 支持,可将下面一个键值对添加到&nbsp;<samp class="codeph" style="font-family: Verdana, Arial, Helvetica, sans-serif, SimSun-18030; ">InfoAdditions</samp>&nbsp;元素:</p><pre style="font-family: Verdana, Arial, Helvetica, sans-serif, SimSun-18030; margin: 12px 10px; padding: 12px 10px 16px; background-color: rgb(240, 247, 254); border: 1px solid rgb(204, 204, 204); overflow-x: auto; color: rgb(51, 51, 51); ">&lt;InfoAdditions&gt;
    &lt;![CDATA[
      &lt;key&gt;NSLocationAlwaysUsageDescription&lt;/key&gt;
      &lt;string&gt;Sample description to allow geolocation always&lt;/string&gt;
      &lt;key&gt;NSLocationWhenInUseUsageDescription&lt;/key&gt;
      &lt;string&gt;Sample description to allow geolocation when application is in foreground&lt;/string&gt;               
    ]]&gt;
&lt;/InfoAdditions&gt;</pre></div></div><div id="userprefs"></div><div id="related"><div id="relatedlinkinfo" style="margin-top: 24px; margin-bottom: 6px; font-weight: bold; color: rgb(136, 136, 136); ">更多帮助主题</div><div><p style="margin-bottom: 4px; "><a href="http://help.adobe.com/zh_CN/air/build/WSfffb011ac560372f-4cb7055d12d779150e8-8000.html" style="text-decoration: none; color: rgb(0, 125, 216); ">requestedDisplayResolution</a></p></div><p xmlns:adobe="http://www.adobe.com/saxon" style="margin-bottom: 4px; "><a href="http://renaun.com/blog/2011/03/developing-for-both-retina-and-non-retina-ios-screens-using-air-2-6/" title="http://renaun.com/blog/2011/03/developing-for-both-retina-and-non-retina-ios-screens-using-air-2-6/" style="text-decoration: none; color: rgb(0, 125, 216); ">Renaun Erickson:使用 AIR 2.6 开发 Retina 和非 Retina iOS 屏幕</a></p><p xmlns:adobe="http://www.adobe.com/saxon" style="margin-bottom: 4px; "><br></p><p xmlns:adobe="http://www.adobe.com/saxon" style="margin-bottom: 4px; "><br></p><p xmlns:adobe="http://www.adobe.com/saxon" style="margin-bottom: 4px; "><br></p><p xmlns:adobe="http://www.adobe.com/saxon" style="margin-bottom: 4px; ">本文来自:<a href="http://help.adobe.com/zh_CN/air/build/WSfffb011ac560372f7e64a7f12cd2dd1867-8000.html">http://help.adobe.com/zh_CN/air/build/WSfffb011ac560372f7e64a7f12cd2dd1867-8000.html</a></p></div></td></tr></tbody></table><p></p>
页: [1]
查看完整版本: Air for IOS 配置文件设置说明