- (void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event
{
if ([[touch view] tag] == 1000)
{
tap=YES;
NSLog(@"tap");
//[yourButton setShowsTouchWhenHighlighted:YES];
if(tap)
{
CGRect myImageRect = CGRectMake(p.x-113, p.y-113, 224.0f, 195.0f);
myImagea = [[UIImageView alloc] initWithFrame:myImageRect];
[myImagea setImage:[UIImage imageNamed:@"Enjoy Sunburst.png"]];
myImagea.opaque = YES; // explicitly opaque for performance
[self.view addSubview:myImagea];
[myImagea release];
}
[pieMenu showInView:self.view atPoint:p];
}
else {
NSLog(@" NO tap");
// i want to remove image when user is not tapping
//how to do that is myImagea.alpha=0 is the only options
}
}
views:
38answers:
2
+1
A:
You can set the hidden
property of the UIImageView
to YES
.
If you would actually want to remove it, you can call removeFromSuperview
.
Jacob Relkin
2010-07-23 14:22:52
A:
I'm going to assume your touch events code is correct...
To actually remove the object, you'd do something similar to this
[someObjectHere removeFromSuperview];
If you're trying to hide it, do what Jacob stated via the hidden
property
iWasRobbed
2010-07-23 14:24:24
thanks you sir :-)
ram
2010-07-23 14:36:10
No problem, good luck
iWasRobbed
2010-07-23 16:38:52