2013-12-12 22 views

回答

2

這是一個自定義類型按鈕。

UIButton* myInfoButton = [UIButton buttonWithType:UIButtonTypeInfoLight]; 
[myInfoButton addTarget:self action:@selector(InfoButtonClicked:) forControlEvents:UIControlEventTouchUpInside]; 
self.navigationItem.rightBarButtonItem = [[UIBarButtonItem alloc] initWithCustomView:myInfoButton]; 

你可以嘗試this also

1
  1. 查找Xcode的對象庫Button對象。 (Button對象,而不是Bar Button Item對象。)
  2. 將Button對象拖到工具欄。
  3. 按住Control並按住Shift的同時單擊新按鈕。
  4. 從彈出菜單中選擇按鈕。這將是菜單中的最後一項。
  5. 在屬性檢查器中,將按鈕類型設置爲「信息燈」。

演示:

adding info button to toolbar in storyboard

+0

乾杯搶劫 - 不錯的圖形,我與其他答案走了,因爲我有一個酒吧按鈕,我想顯示信息符號。看起來它不能證明酒吧按鈕項目的信息符號,所以您必須創建一個常規按鈕並將其分配給酒吧按鈕項目 – SimonTheDiver