Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9185985
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T19:24:43+00:00 2026-06-17T19:24:43+00:00

I am showing a UILabel in appdelegate file on navigation bar (Not exactly on

  • 0

I am showing a UILabel in appdelegate file on navigation bar (Not exactly on navigation bar). It is showing perfect. But no touch event is calling on it. Touch is working only on status bar. Please help. Thanks in advance.

Here is my code.

CGRect frame=[[UIApplication sharedApplication] statusBarFrame];
backgroundImageView=[[UILabel alloc] initWithFrame:CGRectMake(0, frame.size.height, 320, 44)];        
backgroundImageView.tag=50;
[backgroundImageView setTextAlignment:UITextAlignmentCenter];
[backgroundImageView setBackgroundColor:[UIColor colorWithPatternImage:[UIImage imageNamed:@"music.png"]]];
[self.window addSubview:backgroundImageView];

- (void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event 
{   
    NSLog(@"in touched");
}
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-17T19:24:45+00:00Added an answer on June 17, 2026 at 7:24 pm

    As Tyler states in his answer here:

    There is a handy catch-all method in UIWindow called sendEvent: which
    sees every event near the start of the event-handling pipeline. If you
    want to do any non-standard additional event handling, this is a good
    place to put it.

    To intercept all touches you should use UIView subclass for your controller view and override hitTest:withEvent: method in it:

        - (UIView *)hitTest:(CGPoint)point withEvent:(UIEvent *)event {
            touchedView = [super hitTest:point withEvent:event];
            NSSet* touches = [event allTouches];
            // handle touches if you need
            return touchedView;
            }
    

    OR

    2) You can use:

    UITapGestureRecognizer *tgr = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(anyMethod)];  
    [imageView addGestureRecognizer:tgr];  
    [tgr release];  
    
    Before doing this, enable user interaction of UIimageView.
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

while showing progress bar i want to disable touch screen to restrict other functionalities
I have some code here but it's not working. What I want is to
I want to add a little shadow to my UILabel, but it is not
I used the code to try set the label text but its not working.
Select only showing first character of option text in IE 9 Using click on
My Yii code not showing error summery before save movie in database.. what's the
I have a stopwatch that is working just fine on its own, but when
I'm sure I'm overlooking the obvious as I've got countless working buttons...but...for whatever reason
After showing an XPS file in the WPF DocumentViewer, and closing the DocumentViewer instance,
Im showing a video int my application, but its being chopped up, its locally

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.