swift - UISplitViewController displayModeButtonItem()

标签 swift ios8

有人知道更改从 UISplitViewController 委托(delegate)返回的按钮的文本(和外观吗?)的方法:

func displayModeButtonItem() -> UIBarButtonItem?

最佳答案

我自己是这样解决的:

UIBarButtonItem(image: UIImage(named:"home"),
            landscapeImagePhone: UIImage(named:"home"),
            style: UIBarButtonItemStyle.Plain,
            target: splitViewController.displayModeButtonItem().target,
            action: splitViewController.displayModeButtonItem().action)

我在 AppDelegate 中使用它而不是 splitViewController.displayModeButtonItem(),它对我来说工作正常。

关于swift - UISplitViewController displayModeButtonItem(),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/25852593/

相关文章:

ios - 用 CAShapeLayer 画一条线

swift - 结构体传递 self 导致 : self subtype of @lvaue error

ios - 警报 : Open this page in "" 中缺少 URL Scheme 应用名称

iOS swift : nil IBOutlets with custom ViewController

objective-c - 一些 for 循环的问题 - - "Cannot subscript a value of type ' Double' 的索引类型为 'int' “错误

c++ - Objective-C 在传递给 Swift 时释放 C++ 对象。我该如何防止这种情况?

ios - 使用 iOS 8 灵活的表格单元格,单元格高度改变但文本不换行

ios8 - 过早调用 AVAudioPlayerNode.scheduleFile() 的 completionHandler

ios - 现代 iOS 8 NSOperation 使用仍然需要@autoreleasepool 吗?

ios - "Use Auto Layout"和 "Use Size Classes"有什么区别