2
我試圖將UIBarButtonItem
添加到UINavigationController
的工具欄,但它沒有顯示任何按鈕,並且發現_toolbar
陣列在我進行調試時爲空。無法將UIBarButtonItem添加到UINavigationController的工具欄中
override func viewDidLoad() {
var default_title = ["A","B"," C","D"]
var items: NSArray = NSArray()
for title in default_title
{
items.arrayByAddingObject(UIBarButtonItem(title: title, style: UIBarButtonItemStyle.Bordered, target: self, action: ""))
}
self.setToolbarItems(items as [AnyObject], animated: true)
self.setToolbarHidden(false, animated: false)
}