如何禁用触摸UIBarButtonItem时出现的灯光?

时间:2011-02-10 09:03:55

标签: iphone uibutton uibarbuttonitem

我有一个工具栏,其UIBarButtonItem样式为UIBarButtonItemStylePlain。 我想知道如何禁用触摸时出现的光线?

UIButtonshowsTouchWhenHighlighted属性,但是UIBarButtonItem没有这样的事情你可能知道吗?

2 个答案:

答案 0 :(得分:5)

在Interface Builder中,将UIButton拖到工具栏上。它会创建一个UIBarButtonItem,其中包含UIButton。将UIButton的类型设置为自定义。然后,您可以完全自定义外观。例如,将文本颜色更改为白色,将背景颜色更改为透明,当然禁用突出显示。

答案 1 :(得分:0)

您也可以放入UITextField并使其不可编辑。

相关问题