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

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/22850260/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-30 23:54:04  来源:igfitidea点击:

Standard Image Button Icons for iOS in Xcode

ios

提问by Lior Z

Does anyone know where I can find the standard image icons (add, share, refresh, etc.) for iOS? Better yet, can someone direct me to a simple example of adding such a button to a tool bar? I can't seem to find one anywhere.

有谁知道我在哪里可以找到适用于 iOS 的标准图像图标(添加、共享、刷新等)?更好的是,有人可以指导我向工具栏添加这样一个按钮的简单示例吗?我似乎在任何地方都找不到。

Thanks

谢谢

采纳答案by rounak

Use the - (id)initWithBarButtonSystemItem:(UIBarButtonSystemItem)systemItem target:(id)target action:(SEL)action;method to add UIBarButtonsto your toolbar.

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

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

These are the types available

这些是可用的类型

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

回答by ru2wen2

If you are using the Apple Story board,

如果您使用的是 Apple 故事板,

  1. open the story board
  2. click on the UIBarItem, then click on the sytem item as shown in the picture below.
  1. 打开故事板
  2. 单击 UIBarItem,然后单击系统项,如下图所示。

You should be able to set the system icons from here.

您应该可以从这里设置系统图标。

Click on the System Item

点击系统项目