简体   繁体   中英

Can standard iOS UIBarButtonSystemItem icons be referenced through storyboard Attributes Inspector?

The app that I am writing uses a navigation bar and I need to put a standard 'Add' (plus) icon as a bar button item. These standard icons are described here and their use is described here , but the documentation only describes how to reference the icons from code (objective-c or swift).

None of the resources I can find on the subject covers how to specify the image source through the Attributes inspector, where I would set the icon source if it was based on a custom image. Is it not possible to reference default system icons through the Attributes inspector for the Bar Button Item?

It is not intuitive, but the Xcode Attributes inspector has a setting for the Bar Button Item, called 'System Item' (or 'Identifier' in older Xcode versions). When selected it reveals a drop-down menu with identifiers for the system icons. Select the relevant identifier and the Bar Button Item icon will change to the matching icon.

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