简体   繁体   English

UIButton发光效果

[英]UIButton glow effect

I need some help with UIButtons, 我需要有关UIButtons的帮助,

I was wondering how to get the glow effect that I set with the code below to respond to where the touch is. 我想知道如何使用下面的代码设置发光效果,以响应触摸的位置。

[C setShowsTouchWhenHighlighted:YES];

The idea is that when the button is touched it will follow where the touch is. 这个想法是,当触摸按钮时,它将跟随触摸的位置。

You have to do this yourself. 您必须自己做。 Load a glow png into a UIImageView and add it into the view hierarchy. 将glow png加载到UIImageView并将其添加到视图层次结构中。 Then set the view's position based on touches. 然后根据触摸设置视图的位置。

http://i.imgur.com/RS2kQ.png http://i.imgur.com/RS2kQ.png

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM