例如,您看到的大多數「標準」圖標都是蘋果設計的,例如UIToolBar
。他們內置到標準的UIBarButtonItem
類。要初始化其中的一個,你做這樣的事情:
UIBarButtonItem *item = [[UIBarButtonItem alloc] initWithBarButtonSystemItem:(UIBarButtonSytemItem)...
什麼(UIBarButtonSystemItem)
雲可能是:
UIBarButtonSystemItemDone
UIBarButtonSystemItemCancel
UIBarButtonSystemItemEdit
UIBarButtonSystemItemSave
UIBarButtonSystemItemAdd
UIBarButtonSystemItemFlexibleSpace
UIBarButtonSystemItemFixedSpace
UIBarButtonSystemItemCompose
UIBarButtonSystemItemReply
UIBarButtonSystemItemAction
UIBarButtonSystemItemOrganize
UIBarButtonSystemItemBookmarks
UIBarButtonSystemItemSearch
UIBarButtonSystemItemRefresh
UIBarButtonSystemItemStop
UIBarButtonSystemItemCamera
UIBarButtonSystemItemTrash
UIBarButtonSystemItemPlay
UIBarButtonSystemItemPause
UIBarButtonSystemItemRewind
UIBarButtonSystemItemFastForward
UIBarButtonSystemItemUndo
UIBarButtonSystemItemRedo
UIBarButtonSystemItemPageCurl
裏面全是你的iOS各地看到的標準圖標。
我從UIBarButtonItem
class reference那裏得到了這個清單。它包含用例的截圖和描述等內容。
你知道是否有任何方法可以從故事板中引用這些內容(例如在Bar Item屬性 - 圖像中),還是必須創建一個新的子類才能在代碼中加載它? – Giovanni
我相信這是在酒吧按鈕的IB屬性。環顧四周 - 當你看到它時你就會知道它。 – Undo
謝謝 - 你已經接受了答案!還有一件小事情:我認爲標籤欄圖標與任何其他圖標相同 - 如果我已命名爲icon.png Picture.png,那麼我還必須包含另一個圖標,其分辨率爲圖片2x.png的兩倍iOS會自動選擇它是否在視網膜顯示屏上顯示)? – Giovanni