添加动作扩展图标几乎是不可能的 [英] Its just impossible to add an action extension icon

查看:43
本文介绍了添加动作扩展图标几乎是不可能的的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

从字面上看,我已经尝试了两个星期,以获取用于扩展操作的图标,但绝对没有任何效果.

我已经看过诸如

2)其次,它应包含一个应用程序图标图像集,即:

3)第三,人们说他们必须将其目标成员资格添加到扩展程序和应用程序中.这里也是(在所有这些事情中,我都尝试过变体,例如,成员身份只是扩展,只是应用程序,两者都如此)

4)第四,人们提到他们必须将其添加到编译源中,也就是将其复制到捆绑资源中:

5)有人说,还需要将其复制到容器应用程序的捆绑软件中,也就是为了很好地将其添加为该应用程序的编译资源:

6)有人说有必要将容器应用程序资产添加到扩展包中,我看不到这是如何工作的,因为容器应用程序中的图标是彩色的并且不符合扩展程序图标的要求,但是该死的,不妨尝试一切正确的方法,而当我们这样做时,则可以随处添加资产:

7)资产图标本身很重要,没有显示彩色图标,但无论如何我还是尝试过.一个简单的黑白图像被描述为白色部分显示为灰色,但是无论如何我都尝试过.尝试使用不受支持的图标只是绝望和试验,当然我实际上是在使用具有透明背景的图标.当在此处发布时,它当然会在本网页上显示为全白色,但非黑色部分实际上是完全透明的,且alpha为0:

但是,尽管尝试了上述所有步骤的许多组合,但这仍然是设备上的样子:

这使用的是iOS 10.n,最新的10.7(它尚未与任何Beta版一起使用)和Xcode 8.6.如果我从使用动作扩展的应用商店下载了一个应用,那么它们的图标就会出现,因此10 beta版没有问题.问题可能是使用Xcode beta构建应用程序的问题,还是我错过了的某个步骤-如果是这种情况,那又如何呢?

解决方案

最终找到了解决方案-为了使其能够正常工作,还需要设置扩展的构建设置"部分的资产目录"编译器选项,以指定解决方案.资产目录中设置的应用程序图标的名称:

如何设置动作图标确实是iOS上记录最糟糕的一个方面,完全令人震惊.

I've been literally trying for two weeks to get an icon for an action extension to appear, but absolutely nothing works.

I've seen past questions such as this iOS 8 Action Extension icon sizes and this Why isn't my iOS8 Application Action Extension App Icon showing up? but they are of no use.

I've created an Xcode template project purely to try every combination of things mentioned in the other questions, still without avail.

1) The first thing that's mentioned is that the action extension should have its own asset catalog, ok here it is:

2) Secondly that it should contain an app icon image set, here that is:

3) Thirdly people say they had to add its target membership to the extension and to the app. Here that is too (in all of these things, I've tried variations such the membership being just the extension, just the app, both)

4) Fourthly, people mention they had to add it to the compile sources, here that is, as well as it being copied in the bundle resources:

5) Some say it also needs to be copied in the container app's bundle, here that is, and for good measure its been added as a compile resource of that too:

6) One person says it was necessary to add the container apps assets to the extension bundle, I can't see how that would work as the icons in the container app are colored and not matching the requirements of the extension icons, but what the hell, might as well try everything right, and while we're at it lets add assets everywhere:

7) The asset icon itself is important, colored icons are not displayed, but I tried it anyway. A simple black and white image is described as the white parts appearing as grey but I've tried that anyway. Trying unsupported icons was just desperation and experimentation, of course I'm actually using an icon with a transparent background. When posted here it appears on this webpage as all white of course, but the non-black parts are actually fully transparent and have an alpha of 0:

But despite trying many combinations of all the various steps above, this is what it looks like on the device:

This is using iOS 10.n, latest 10.7 (it hasn't worked with any beta) and Xcode 8.6. If I download an app from the app store that uses action extensions then their icons are appearing, so there's no issue with the 10 beta. The issue is either something building the app with Xcode beta, or some step I've missed out - if that is the case, then what?

解决方案

Finally found out the solution - in order to get it to work its additionally necessary to set the Asset Catalog compiler options of Build Settings section of the extension to specify the name of the app icon set within the asset catalog:

How to set an action icon really is the most appallingly badly documented aspect of iOS, totally shockingly awful.

这篇关于添加动作扩展图标几乎是不可能的的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆