本文介绍了UISplitViewController displayModeButtonItem()的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
有人知道如何更改从UISplitViewController委托返回的按钮的文本(和外观?):
Does someone know a way to change the text (and appearance?) of the button returned from the UISplitViewController delegate:
func displayModeButtonItem() -> UIBarButtonItem?
推荐答案
我以这样的方式为自己解决了这个问题:
I resolved it for myself in such way:
UIBarButtonItem(image: UIImage(named:"home"),
landscapeImagePhone: UIImage(named:"home"),
style: UIBarButtonItemStyle.Plain,
target: splitViewController.displayModeButtonItem().target,
action: splitViewController.displayModeButtonItem().action)
我在AppDelegate而不是 splitViewController.displayModeButtonItem()
中使用它,它对我来说很好。
I use this in AppDelegate instead of splitViewController.displayModeButtonItem()
and it works fine for me.
这篇关于UISplitViewController displayModeButtonItem()的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!