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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T19:23:43+00:00 2026-05-25T19:23:43+00:00

What it did in RootviewController of UISplitViewController – UISearchBar *searchBar = [[UISearchBar alloc] initWithFrame:CGRectMake(0,

  • 0

What it did in RootviewController of UISplitViewController –

UISearchBar *searchBar = [[UISearchBar alloc] initWithFrame:CGRectMake(0, 0, self.tableView.frame.size.width, 0)];  
    [searchBar setPlaceholder:@"Search within application"];
    searchBar.delegate = self; 
    [searchBar sizeToFit]; 
    searchBar.tintColor=[[UIColor alloc] initWithRed:212.00/255 green:236.00/255 blue:256.00/255 alpha:1.0 ];

    self.tableView.tableHeaderView = searchBar;  
    [searchBar release]; 

It’s working fine but when we scroll tableview searchbar is also moving with tableview rows.

I want to implement searchbar which will always visible to the user.

I can try with SearchDisplayController but in UISplitViewController we are not getting .xib file for RootViewController.

Please help me out on this.

  • 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-25T19:23:44+00:00Added an answer on May 25, 2026 at 7:23 pm

    You can add your search bar to the navigation controller’s navigation bar. Here are the steps:

    1. change the frame of the navBar by adding the height of the search bar to its frame.origin.height.
    2. add the search bar as a subview
    3. change the class of the controller’s view to UIView (assuming it is now a table view) and add a new subview UITableView, adjusting the frame according to your search bar height.
    4. reconnect the new tableView with the controller (delegate, datasource, tableView outlet).

    This worked for me.

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

Sidebar

Related Questions

From the standard view-based application, I found that the generated code did this: self.window.rootViewController
My RootViewController is a UITableViewController. A UINavigationController is added programmatically: _navigationController = [[[UINavigationController alloc]
The SimpleEKDemo sample has a [self.tableView reloadData] at the end of viewDidLoad in the
I use Google AdMob SDK in my iPhone app, I did set the rootViewController
Did you ever have to choose between WISA or LAMP at the beginning of
Did you ever had a bug in your code, you could not resolve? I
Did anyone of you ever find a way of getting the Microsoft Report Viewer
Did you ever use Oracle auditing features on a production db? How did that
Did Microsoft abandon support for Windows Presentation Foundation (WPF) on Visual Studio 2005? There
Did the recent purchase of MySQL by Sun and the subsequent buggy releases kill

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.