gpt4 book ai didi

android - AIR ADT 重复包中的图标

转载 作者:行者123 更新时间:2023-11-29 03:03:36 25 4
gpt4 key购买 nike

设置

According to documentation ,在应用程序 descriptor-app.xml 中指定的图标必须相对于应用程序根目录,并且不会自动添加到包中。

The path specified is relative to the application root directory.

Note: The icons specified are not automatically added to the AIR package. The icon files must be included in their correct relative locations when the application is packaged.

文档本身提供了一个使用 icons 文件夹的示例

<icon> 
<image16x16>icons/smallIcon.png</image16x16>
<image32x32>icons/mediumIcon.png</image32x32>
<image48x48>icons/bigIcon.png</image48x48>
<image128x128>icons/biggestIcon.png</image128x128>
</icon>

我将使用以下 ADT 命令将此文件夹包含在我的应用程序根目录中:
adt [STUFF] outputfile.apk descriptor-app.xml main.swf icons

结果

这又会产生以下包结构1(不列出不相关的路径):

 package.apk  |---> assets (this is the application root on Android package)  |      |---> icons  |      |      |---> smallIcon.png  |      |      |---> mediumIcon.png  |      |      |---> bigIcon.png  |      |      |---> biggestIcon.png  |      |---> main.swf  |---> res         |---> drawable-hdpi         |      |---> icon.png         |---> drawable-ldpi         |      |---> icon.png         |---> drawable-mdpi         |      |---> icon.png         |---> drawable-xhdpi                |---> icon.png

1 大小到路径的实际转换 as detailed here

问题

res/drawable* 下文件夹中的图标是 assets/icons 下图标的副本。 “drawable”文件夹是 Android 包的特定结构。据我了解,adt 命令将获取 descriptor-app.xml 中指定的图标,并将它们放置在包中的正确位置,具体取决于包类型(iOS图标在包中的位置与 Android 图标不同)。

我不明白的是:为什么我必须在我的应用程序根目录中包含 icons 文件夹?

adt 知道图标需要在哪里结束,但是 descriptor-app.xml 要求图标路径是相对于“应用程序根目录”指定的。

在 iOS 上,有点可以通过将图标重命名为它们的最终名称并将它们放在包中的正确位置来解决2,因为ipa 结构将图标放置在与应用程序根目录相同的上下文中

但在 Android 上,这甚至是不可能的,因为 apk 结构将图标放置在应用程序根上下文之外,而 adt 不会不要让我将文件添加到应用程序根目录之外的包中。

然而,文档告诉我一些对于 apk 包来说完全不可能的事情:

The icon files must be included in their correct relative locations when the application is packaged.

2 为 iOS 手动重命名图标并将它们放置在正确的应用程序根位置也不理想,因为 adt 已经知道该怎么做,而且我因为用户可能会犯错

回到问题:为什么我必须在应用程序中包含 icons 文件夹才能正确使用它?我没有在应用程序中包含 descriptor-app.xml(但 adt 将其放入正确的包位置,每个操作系统本身),但为什么要强制我包含冗余图标的副本?

我错过了什么吗?有解决方法吗?

最佳答案

此问题已在最新的 AIR SDK 21.0 Beta 21.0.0.150 中修复。

https://bugbase.adobe.com/index.cfm?event=bug&id=4100164

关于android - AIR ADT 重复包中的图标,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/23016780/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com