我将尝试通过编程的方式向工具栏添加barButtonItem,但除了工具栏本身外,没有任何项目显示出来。
到目前为止,我的代码如下:
到目前为止,我的代码如下:
self.navigationController?.setToolbarHidden(false, animated: false)
var items = [UIBarButtonItem]()
items.append(
UIBarButtonItem(barButtonSystemItem: .bookmarks, target: nil, action: nil)
)
self.navigationController?.toolbar.setItems(items, animated: false)
self.navigationController
是否已设置? - undefinedself.navigationItem.rightBarButtonItem = UIBarButtonItem(barButtonSystemItem: .bookmarks, target: nil, action: nil)
来完成它。 - undefined