如何禁用触摸UIBarButtonItem时出现的光? [英] How to disable the light that appears when touching a UIBarButtonItem?

查看:72
本文介绍了如何禁用触摸UIBarButtonItem时出现的光?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个样式为UIBarButtonItemStylePlainUIBarButtonItem工具栏. 我想知道如何禁用触摸时出现的灯光?

I have a toolbar with a UIBarButtonItem with style: UIBarButtonItemStylePlain. I wonder how can I disable the light that appears while touching it?

UIButton具有showsTouchWhenHighlighted属性,但是对于UIBarButtonItem没有这样的事情,您是否可能知道解决方法?

UIButton has showsTouchWhenHighlighted property but there is no such a thing for UIBarButtonItem is there a work-around you might know?

推荐答案

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

In Interface Builder drag a UIButton to the toolbar. It will create a UIBarButtonItem with a UIButton in it. Set the type of the UIButton to custom. Then you can fully customize the appearence. For example change the text color to white and the background color to transparent and of course disable the highlighting.

这篇关于如何禁用触摸UIBarButtonItem时出现的光?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆