如何在工具栏上为xcode创建自定义栏按钮项目

问题描述:

我不想为我的工具栏使用默认按钮。我想创造我自己的。我应该如何去做这件事?我需要知道如何在工具栏上为xcode创建自定义栏按钮项目

  • 尺寸

  • 如何将它们导入到Xcode项目。如在,我是否把它们放入资产。

可以使用的UIButton创建一个自定义的UIBarButtonItem。 Todo这个,将你的UIButton作为UIBarButtonItem的一个参数。


事情是这样的:

let customButton = UIBarButtonItem(customView: button) 

就拿在我的例子看看: iOS-CustomButton