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 8480687
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T19:21:47+00:00 2026-06-10T19:21:47+00:00

The frame where the UISearchBar is drawn is the following: UISearchBar *sBar=[[UISearchBar alloc]initWithFrame:CGRectMake(0, 0,

  • 0

The frame where the UISearchBar is drawn is the following:

UISearchBar *sBar=[[UISearchBar alloc]initWithFrame:CGRectMake(0, 0, 280, 40)];

Simply i want to dismiss the keyboard when the user click on ANY area than the area defined above.

Is there any UISearchBar delegate method to do so, or a simple way. Thanx in advance.

  • 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-10T19:21:48+00:00Added an answer on June 10, 2026 at 7:21 pm

    You’ll need to handle click/touch events on the other views in your window, and call:

    if (sBar.isFirstResponder)
        [sBar resignFirstResponder];
    

    sBar will need to be a property of your UIViewController

    To handle touch events, add these to your UIViewController:

      - (void) touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event
        {
        }
    
        - (void) touchesMoved:(NESet *)touches withEvent:(UIEvent *)event
        {
        }
    
        - (void) touchesEnded:(NESet *)touches withEvent:(UIEvent *)event
        {
        }
    
    - (void) touchesCancelled:(NESet *)touches withEvent:(UIEvent *)event
        {
        }
    

    and call [sBar resignFirstResponder] from at least the touchesBegan method.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

What it did in RootviewController of UISplitViewController - UISearchBar *searchBar = [[UISearchBar alloc] initWithFrame:CGRectMake(0,
I have the following frame: <iframe src=http://www.eggsandbacon.jquery.js></iframe> Inside my index.html document. I want to
I have a searchBar (with scopeBar) where I want to dismiss the keyboard when
I have a frame extends from JWindow (because I want to handle my X
I have a data frame containing the following fields: a, b, c. a and
[selectorView setFrame:CGRectOffset([selectorView frame], 0, -selectorView.frame.size.height)] In the above code I want to change the
I have a data.frame with the following characteristics: +-----------------------------------------+ | earning budget ts total
I have a data frame with a series of times in the following format:
I want to lauch camera with customised frame so that I should be able
PROBLEM I want to keep the UISearchBar at the top of my UITableview, but

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.