How can I make the shiny glow effect around an icon/image? (Pics provided inside)
Before mouse over:
after mouse over:
Seems like the glow effect will change its shape according to the image 开发者_C百科shape. Is this a NSShadow? How to implement this in code? Any clues or examples? Thanks a lot.
I could with iOS but I think the same applies:
- set zero offset for the shadow
- blur it enough
- give right size
- and choose white as color.
This is what I used in my case, which is practically the same as the other answer but with code:
myImage.layer.shadowColor = [UIColor whiteColor].CGColor;
myImage.layer.shadowRadius = 4.0f;
myImage.layer.shadowOpacity = .9;
myImage.layer.shadowOffset = CGSizeZero;
myImage.layer.masksToBounds = NO;
Taken from here
精彩评论