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

  • Home
  • SEARCH
  • 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 8094413
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T20:47:33+00:00 2026-06-05T20:47:33+00:00

This is driving me crazy. I am creating a splitview app on iPad. I

  • 0

This is driving me crazy. I am creating a splitview app on iPad.

I have created a searchBar inside the UINavigationBar – something like this…

UISearchBar *searchBar = [[UISearchBar alloc] initWitFrame:CGRectZero];
[searchBar setPlaceHolder:@"Search"];
[searchBar sizeToFit];
[searchBar setDelegate:self];
[self.navigatioItem setTitleView:searchBar];

this works just fine for me displaying the UISearchBar like this…

enter image description here

I also have this UIBarButtonItem set to show Master navigation controller in sidepane.

The problem happens when the device rotates to landscape and the UIBarButtonItem gets hidden. Then the searchBar appears like this…

enter image description here

there is some space on sides which appears to be there since the barButtonItem got hidden and the size of search bar couldn’t be updated.

Furthermore, when I rotate the device again, here’s what happens to UISearchBar

enter image description here

How can I update the size of searchbar once it has been added to UINavigationBar. Even using autoResizingMask does not work.

searchBar.autoResizingMask =UIViewAutoresizingFlexibleWidth;

What am I doing wrong over here?

  • 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-05T20:47:35+00:00Added an answer on June 5, 2026 at 8:47 pm

    I had about the same problem (it wasn’t searchbar, but some UIView), and that’s how I solved it:

    Try creating it with fixed size that won’t change. I mean if your navbar minimum size is (for example) 320pt, and barbutton is about 30pt, and you need searchbar to be placed right in the middle (which, BTW is not standart, AFAIK), you’d have to make it 320 – (30+10)*2 = 240pt. Searchbar would be placed right in the middle and will have enough place left free.

    This way it will neither change it’s size, nor it will affect other items.

    Or I would suggest you placing it at right position, not in the middle.

    Hope it helped.

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

Sidebar

Related Questions

This is driving me crazy, I am trying to do something like: $this->data =
This is driving me crazy. I have a very simple user control: public int?
This is driving me crazy and I can't find the answer anywhere. I have
Ok, this is driving me crazy. I have a CA that needs to know
This has been driving me crazy for the past few minutes I have a
This has been driving me crazy. I think I have everything in place but
This is driving me crazy. I have the following string in a ASP.NET 2.0
This is driving me crazy! I have read at least 5 questions on here
This is driving me crazy: I have function void gst_init(int *argc, char **argv[]); in
This is probably a simple question, but it's driving me crazy! I have a

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.