将UIBarButtonItem添加到UITabBarController

时间:2015-08-28 08:37:08

标签: ios swift uitabbarcontroller uibarbuttonitem

我们如何将UIBarButtonItem添加到UITabBarController?

    leftMenuBarButtonItem = UIBarButtonItem();
    leftMenuBarButtonItem.image = UIImage(named: "menuIcon");
    leftMenuBarButtonItem.target = self;
    leftMenuBarButtonItem.action = "leftMenuBarButtonItemClicked:";
    self.navigationItem.setLeftBarButtonItem(leftMenuBarButtonItem, animated: true);

上述代码不起作用。任何想法?

0 个答案:

没有答案