简体   繁体   English

如何在资产目录中设置可访问性标签? Xcode 11

[英]How to set the accessibility label in asset catalog? Xcode 11

Is there any way to set the accessibilityLabel for an image asset inside the asset cataloge?有没有办法为资产目录中的图像资产设置accessibilityLabel标签? I don't want to handle that label everywhere I use that image asset.我不想在我使用该图像资产的任何地方处理该标签。

Is there any way to set the accessibilityLabel for an image asset inside the asset catalog?有没有办法为资产目录中的图像资产设置accessibilityLabel

The .xcassets is definitely not done for this purpose . .xcassets绝对不是为此目的而做的

However, you can create a new UIView including the image you're using everywhere so as to define the accessibilityLabel in it once for all.但是,您可以创建一个新的 UIView,包括您在任何地方使用的图像,以便一次性定义其中的accessibilityLabel

You use this new UIView in place of the image coming from your asset catalog and you don't have to handle that label everywhere .你使用这个新的UIView代替来自你的资产目录的图像,你不必在任何地方处理那个标签 😉 😉

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM