I want to place a large, non-interactive transparent UILabel as an overlay on part of my screen, however,
it's interfering with with the controls/buttons underneath it. It's basically blocking all of my touches.
It won't allow me to click on anything.
I want to place a large, non-interactive transparent UILabel as an overlay on part of my screen, however,
it's interfering with with the controls/buttons underneath it. It's basically blocking all of my touches.
It won't allow me to click on anything.
I set this flag:
However, this doesn't help. It's still blocking.
Any suggestions?
That's weird. Setting userInteractionEnabled to false should fix the problem. Is there any chance that the link to the label is broken, and that code is dealing with a nil outlet?
Set a breakpoint on that line, and make sure the pointer to your label is valid.
Check out this password generator app that shows various techniques including using a data container singleton object to share data between objects in your project.
That's weird. Setting userInteractionEnabled to false should fix the problem. Is there any chance that the link to the label is broken, and that code is dealing with a nil outlet?
Set a breakpoint on that line, and make sure the pointer to your label is valid.
Thanks, you're correct, it works if I just add the label to the view and do nothing else to it.
However, I should mention that I also animate it so it fades out slowly. All of my clicks are
blocked when this animation is playing. Should it work like this?
This is what I'm doing:
Code:
// create label that covers the entire screen
CGRect rect = CGRectMake(0,0, self.view.frame.size.width, self.view.frame.size.height );
MyLabel *tmp = [[MyLabel alloc] initWithFrame:rect];
tmp.text = @"Testing";
// non-interactive
tmp.userInteractionEnabled = FALSE;
// save it
self.myLabel = tmp;
// add it to top of view
[self.view addSubview: tmp];
[tmp release];
// fade alpha
[self.myLabel animateFadeOut];
/////////////////////////////////////////////////////////////
-(void)animateFadeOut {
self.alpha = 1.0f;
float delay = 5.0;
[UIView animateWithDuration: delay
animations: ^{
self.alpha = 0.0f;
}
completion: ^(BOOL finished) {
// get rid of it
[self removeFromSuperview];
}];
}