我发布了一个关于模仿地图应用程序界面的问题,并且刚刚遇到了另一个我不确定UIToolbar和UIBarButtonItem的区域。
在地图应用程序中,有两个按钮似乎没有在UIBarButtonItem documentation
中定义任何常量在应用程序的左下角是“位置”图标,点击“方向”时,还有另一个“切换路径”图标,这两个图标都没有在UIBarButtonItem.h中定义
我猜这些尚未添加到iOS 4中了吗?这是否意味着包含此类按钮/图像的唯一方法是在创建UIBarButtonItem时使用initWithImage:style:target:action:方法?
这不是问题,虽然找到类似的图像会很痛苦,但我只是想确保自己,而不是在尝试包含这些元素时重新发明轮子。
另外,我注意到虽然所有其他UI元素都可以根据颜色设置样式,但PageCurl按钮项似乎根本不想更改。即:我可以使所有其他工具栏按钮的颜色与默认颜色不同,但页面卷曲拒绝更改。也许我在这里错过了一些简单的东西?
感谢阅读!
答案 0 :(得分:1)
正确,此处的iOS文档是默认情况下唯一可用的系统图标。您可以放心地假设此列表之外不存在任何内容,如果您想要不同的内容,则必须使用自己的图像:
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;