开发者

How to disable the light that appears when touching a UIBarButtonItem?

开发者 https://www.devze.com 2023-02-10 04:20 出处:网络
I have a toolbar with a UIBarButtonItem with style: UIBarButtonItemStylePlain. I wonder how can I disable the开发者_JAVA百科 light that appears while touching it?

I have a toolbar with a UIBarButtonItem with style: UIBarButtonItemStylePlain. I wonder how can I disable the开发者_JAVA百科 light that appears while touching it?

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


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.


You can also drop in a UITextField and make it non-editable.

0

精彩评论

暂无评论...
验证码 换一张
取 消