【问题标题】:Creating A Toolbar Info Button in Interface Builder在 Interface Builder 中创建工具栏信息按钮
【发布时间】:2013-01-29 00:58:21
【问题描述】:

我知道如何使用UIButton:buttonWithType:UIBarButtonItem:initWithCustomView: 并提供UIButton:buttonWithType 参数UIButtonTypeInfoLight 以编程方式创建工具栏按钮。

我真正想做的是将系统按钮拖到通用 barbuttonitem 上以获取信息按钮。在界面生成器中。这是一个人可以做的事情,还是我应该自己动手写代码?

【问题讨论】:

  • 即你只想拥有一个自定义的 barButtonItem?
  • 不,你不能那样做。起来。

标签: ios button xcode4.5 toolbar


【解决方案1】:

试试这个...

let     infoButton        = UIButton.init( type: .infoLight )
let     infoBarButtonItem = UIBarButtonItem.init( image:  infoButton.image( for: .normal ),
                                                  style: .plain,
                                                  target: self,
                                                  action: #selector( infoBarButtonItemTouched ) )

【讨论】:

    猜你喜欢
    • 2011-07-02
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2015-09-22
    • 1970-01-01
    • 1970-01-01
    • 2012-08-15
    相关资源
    最近更新 更多