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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T14:00:51+00:00 2026-05-13T14:00:51+00:00

I have placed a UISearchBar in my UITableView.tableHeaderView. However it covers the searchBar by

  • 0

I have placed a UISearchBar in my UITableView.tableHeaderView. However it covers the searchBar by placing the viewable top to the first section header. I can only see the searchBar when I drag the tableView down. It is half covered and then can not be selected because releasing the tableView scrolling will rubber band it back out of view. Please help.

The following is placed in my UITableViewController viewDidLoad method:

UISearchBar *theSearchBar = [[UISearchBar alloc] init];
theSearchBar.delegate = self;
self.searchBar = theSearchBar;
[theSearchBar release];

self.tableView.tableHeaderView = self.searchBar;

The result is the following screenshots: http://imagebin.ca/view/6qNiwHR.html

  • 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-05-13T14:00:52+00:00Added an answer on May 13, 2026 at 2:00 pm

    I think the tableHeaderView is not the best place to put your search bar.
    I usually use a UISearchDisplayController:

    searchController = [[UISearchDisplayController alloc]
                         initWithSearchBar:theSearchBar contentsController:self];
    searchController.delegate = self;
    searchController.searchResultsDataSource = self;
    searchController.searchResultsDelegate = self;
    

    It’s pretty straight-forward and give some functions for searching (you have to implement them in the delegate/datasource, in this case your controller).

    I usually do it from a nib but i think you just have to assign it to your viewcontroller :

    self.searchDisplayController=searchController;
    

    And if it doesn’t show the view, you should add the view to the tableView directly.

    You can look at the reference, or ask if you have some problems.

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

Sidebar

Related Questions

I have placed string argument in the method header called methodASet. Is it possible
I have a UITableView wherein I have placed a UIButton (as a subview of
I have placed the following code at the top of index.php: if (!isset($_SERVER['REMOTE_ADDR'])){ $_SERVER['QUERY_STRING']
I have placed UITextField over each UITableView cell. While scrolling the UITableView cell the
I have placed my website in my dropbox so you can see my problem.
I have placed a div .ontopdivs on top of another div .notradewin with jQuery
I have placed an image on the master page. I see the image at
I have a horizontal list on which I have placed borders on the li
I am using Ajax tab container control with 3 tabs. I have placed a
I have images placed in following path res>drawable>Images>Currencies>[All images] I have made a custom

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.