简体   繁体   中英

System images are showing on iOS 13, but not on iOS 12 and before

I'm using Storyboard editor on XCode 11.3.1 to create a UIButton with an icon. When I add a "system" image to a button, eg, named square.and.pencil, it shows it in Storyboard and on iOS 13 devices. But on iOS 12, it shows nothing. Any way to use system icons for older iOS?

Also note:

  • User-created images from assets are working everywhere with my setup.
  • UIBarButtonItem shows the same icon on all devices, but it's specified with "System Item: Compose," not with an image named square.and.pencil.

适用于 iOS 13,但不适用于 iOS 12

What you are using is an .SVG image, provided like a system icon with Xcode 11. This one and 1500 more are available on SF Symbols app, made by Apple. You can read more about SF Symbols and download it here . However, as you can read on the link,

You can use SF Symbols in apps running in iOS 13 and later, watchOS 6 and later, and tvOS 13 and later.

these are only available for iOS13 and up, so that is why the image is not displayed on iOS12.

If you want to use that exact same image on iOS 12, export it as .PNG using SF Symbols and add it as a resource to your project.

I would like to suggest you this app which will simplify your life. https://happycoding.app/index.html From the link you can download the app. This app allows you to download the icons of material design ios default icons and many more, just remember you give same name to icons as they have for ios 13*. Also it helps you in many other ways like pods info plist files and lot more. You should give it a try.

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