tags:

views:

1093

answers:

4

Hello,

In my IPhone application, I want the text in UILabel to glow for a second, then fade for a sec;. Also i want to repeat this cycle for say 3 or 4 times.

Is this possible?

A: 

Yes. Use beginAnimation...commitAnimation, and use the alpha value to brighten or dim the ULabel. Make sure that the default value of the UILabel's alpha starts at 0.85 and brightens to 1.0 and then dims to 0.75, and when all is done, you go back to 0.85.

There are other ways to do it such as having another view on top of the label that is gray or black and you use the same begin...commitAnimation to change the alpha on that from 0 to 0.20 or so.

mahboudz
Read the question please
SeniorShizzle
A: 

Thanks for your reply. It is working fine.

But it is not appearing to be a glow effect. I cannot use images because, my module requires 288 images to bring this effect.

Is there any other way to bring glow effect to text in UILabel?

Ramkumar
How do you define a "glow effect"? What does it look like?
Elliot
Wild guess; he is talking about something like a bloom/overbright effect. If that guess is correct, the answer is: you will have to implement that entirely yourself as the platform does not supply you with anything that does it.
Till
Is there any sample codes around ?
Shivan Raptor
+1  A: 

There are many ways to do this, with varying quality. One way would be to subclass UILabel, and implement some kind of gradient effect in coregraphics in the drawRect method.

You can also play with the text shadow (change the colour and alpha) and see if you can come up with a decent glow.

The easiest way is probably to make a transparent glow-outline image in photoshop and place it behind your text, and then do like mahboudz suggests... fade the image in and out using coreanimation.

Kenny Winker
+1  A: 

I've posted some sample code which subclasses UILabel and enables you to apply glow and soft shadows to text.

http://www.redrobotstudios.com/blog/2010/04/29/create-glow-soft-shadow-text-on-iphone/

andrewgleave