Xcode中iOS的标准图像按钮图标

时间:2014-04-03 22:35:13

标签: ios

有谁知道我在哪里可以找到iOS的标准图片图标(添加,分享,刷新等)?更好的是,有人可以指导我将一个按钮添加到工具栏的简单示例吗?我似乎无法在任何地方找到一个。

谢谢

2 个答案:

答案 0 :(得分:8)

使用- (id)initWithBarButtonSystemItem:(UIBarButtonSystemItem)systemItem target:(id)target action:(SEL)action;方法将UIBarButtons添加到工具栏。

UIBarButtonItem *barButton = [[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemSearch target:target action:action];

这些是可用的类型

UIBarButtonSystemItemDone,
UIBarButtonSystemItemCancel,
UIBarButtonSystemItemEdit,  
UIBarButtonSystemItemSave,  
UIBarButtonSystemItemAdd,
UIBarButtonSystemItemFlexibleSpace,
UIBarButtonSystemItemFixedSpace,
UIBarButtonSystemItemCompose,
UIBarButtonSystemItemReply,
UIBarButtonSystemItemAction,
UIBarButtonSystemItemOrganize,
UIBarButtonSystemItemBookmarks,
UIBarButtonSystemItemSearch,
UIBarButtonSystemItemRefresh,
UIBarButtonSystemItemStop,
UIBarButtonSystemItemCamera,
UIBarButtonSystemItemTrash,
UIBarButtonSystemItemPlay,
UIBarButtonSystemItemPause,
UIBarButtonSystemItemRewind,
UIBarButtonSystemItemFastForward,

答案 1 :(得分:6)

如果您使用的是Apple Story板,

  1. 打开故事板
  2. 单击UIBarItem,然后单击系统项,如下图所示。
  3. 您应该可以从此处设置系统图标。

    Click on the System Item