简体   繁体   中英

UIBarButtonSystemItem enum - Missing Icons?

I posted a question about mimicking the interface of the Maps application and have just come across another area where i'm unsure about the UIToolbar and UIBarButtonItem's.

In the Maps application, there are two buttons which don't seem to have any constant defined in the UIBarButtonItem documentation

At the bottom left of the app is the "location" icon and when clicking "directions" there is another "switch route" icon, neither of which are defined in the UIBarButtonItem.h

I'm guessing that these haven't been added to iOS 4 yet? Does this mean that the only way to include such buttons/images is to use the initWithImage:style:target:action: method when creating a UIBarButtonItem?

This isn't a problem, although finding similar images would be pain, I just want to make sure i'm, not reinventing the wheel when trying to include such elements.

Also, I note that whilst all the other UI elements can be styled in terms of color, the PageCurl button item doesn't seem to want to change at all. Ie: I can make all of the other toolbar buttons a different color to the default but the page curl refuses to change. Perhaps i'm missing something simple here?

Thanks for reading!

Correct, from the iOS documentation here are the only system icons available by default. You can safely assume that nothing outside of this list exists and you have to use your own image for it if you want something different:

typedef enum {
   UIBarButtonSystemItemDone,
   UIBarButtonSystemItemCancel,
   UIBarButtonSystemItemEdit,
   UIBarButtonSystemItemSave,
   UIBarButtonSystemItemAdd,
   UIBarButtonSystemItemFlexibleSpace,
   UIBarButtonSystemItemFixedSpace,
   UIBarButtonSystemItemCompose,
   UIBarButtonSystemItemReply,
   UIBarButtonSystemItemAction,
   UIBarButtonSystemItemOrganize,
   UIBarButtonSystemItemBookmarks,
   UIBarButtonSystemItemSearch,
   UIBarButtonSystemItemRefresh,
   UIBarButtonSystemItemStop,
   UIBarButtonSystemItemCamera,
   UIBarButtonSystemItemTrash,
   UIBarButtonSystemItemPlay,
   UIBarButtonSystemItemPause,
   UIBarButtonSystemItemRewind,
   UIBarButtonSystemItemFastForward,
   UIBarButtonSystemItemUndo,        // iOS 3.0 and later
   UIBarButtonSystemItemRedo,        // iOS 3.0 and later
   UIBarButtonSystemItemPageCurl,    // iOS 4.0 and later
} UIBarButtonSystemItem;

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