简体   繁体   中英

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? 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?

The .xcassets is definitely not done for this purpose .

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.

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 . 😉

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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