I'd like to hide an UIImage with a code in a method ... then display something else in its place and then re-enable it again. How would I go about doing this ?
I know how to do this with UILabels (myLabel.hidden = YES) but not with UIImage
thank you!
Make sure that your UIImage
is enclosed inside of a UIImageView
:
UIImage *theImage = [UIImage imageNamed:@"someImageName.png"];
UIImageView *imgView = [[UIImageView alloc] initWithImage:theImage];
self.imageView = imgView; // assuming you have a property called imageView
[imgView release];
[self.view addSubview:self.imageView]; //in your view controller
once you've done this, you can use:
[self.imageView setHidden:YES];
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With