George Friday
George Friday

Reputation: 585

Hide image when same button pushed

I know how to show an image when a button is pressed. But how do you "hide" the image again once the button is pressed a second time? Here is all I have so far...

-(IBAction)Light
{
    LightLCD.hidden = NO;
}

Upvotes: 0

Views: 62

Answers (2)

Avi Tsadok
Avi Tsadok

Reputation: 1843

Like this:

- (IBAction)Light
{
    LightLCD.hidden = !LightLCD.hidden;
}

This way you can toggle the visibility of the imageView.

Upvotes: 0

Anupdas
Anupdas

Reputation: 10201

Try

-(IBAction)Light
{
    LightLCD.hidden = !LightLCD.hidden;
}

Upvotes: 4

Related Questions