iphone - How to change the alpha of a UILabel by tapping? -



iphone - How to change the alpha of a UILabel by tapping? -

i have ios (4.0) app alter alpha of specific uilabel of taping anywhere on screen. don't have interface done programmatically, used interface builder place labels things on screen.

how can utilize tap gesture alter alpha of specific uilabel in program?

thanks in advance!

in viewdidload:

uitapgesturerecognizer *onetap = [[uitapgesturerecognizer alloc] initwithtarget:self action:@selector(tapaction:)]; [onetap setnumberoftapsrequired:1]; [onetap setnumberoftouchesrequired:1]; [self.view onetap];

then define method:

-(void)tapaction:(uigesturerecognizer *)gesture { [self.yourlabel setalpha:0.5f]; // set alpha whatever want, or animate fade, whatever }

iphone ios uilabel alpha

Comments

Popular posts from this blog

iphone - Dismissing a UIAlertView -

c# - Can ProtoBuf-Net deserialize to a flat class? -

javascript - Change element in each JQuery tab to dynamically generated colors -