2014-05-01 51 views
11

嗨,我是IOS開發新手。我知道如何在IOS應用程序中使用圖像。但我不知道如何使用開發人員網站中提到的共享或書籤圖標等默認圖像。我想用它們。我必須下載那些圖像集或在xcode中可用的圖像集。如果我們必須下載這些圖像集合,那麼我可以在那裏獲得這些圖標。需要幫助謝謝。如何使用默認IOS圖像

+0

你能提供鏈接到頁面,其中顯示的是你問的圖像? –

+0

或者,如果你附上問題,它會更好。 –

+0

https://developer.apple.com/library/ios/documentation/userexperience/conceptual/mobilehig/BarIcons.html#//apple_ref/doc/uid/TP40006556-CH21-SW1 – nilkash

回答

5

開發人員無法直接訪問這些圖像。我的意思是你不能初始化像這樣的圖像對象:

UIImage *image = [UIImage imageNamed:@"name_of_system_image"]; 

但你可以通過使用系統類型顯示一些圖像。例如,你可以初始化UIBarButtonItem與系統類型,提供標準圖標:
- (id)initWithBarButtonSystemItem:(UIBarButtonSystemItem)systemItem target:(id)target action:(SEL)action

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

+0

不幸的是,在這種情況下,您無法修改標題並卡住這些圖像的iOS默認標題,是否正確? –

+0

是的,@YuriS,你不能改變系統項目的標題。這是因爲它們會自動爲您「本地化」:它們將以用戶在其設備上設置的任何語言顯示。如果您想爲標題使用自己的文本,並且希望以不同語言顯示文本,則必須爲自己的文本提供自己的翻譯。 – leanne