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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T12:20:53+00:00 2026-06-15T12:20:53+00:00

I am adding a dynamically scrolling UISearchBar to the top of a tableview. To

  • 0

I am adding a dynamically scrolling UISearchBar to the top of a tableview. To do this, I have added the UISearchBar as a subview of the tableview and then implemented a scrollviewdelegate method so that the searchbar stays pinned to the top at all times. I also set the contentInset of the tableView accordingly so that the top most cell is offset enough for the searchbar.

The only issue I’m having is with the default separator that’s drawn above the first cell in the tableview. When starting at the top, and scrolling down, the separator is actually drawn above the search bar, instead of below it. This creates for a horrible user interface bug that I’d like to fix. Note that this only happens with the first cell; every other separator between cells scrolls under the searchbar, as it should, and does not have the same UI bug. Any thoughts?

enter image description 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-15T12:20:55+00:00Added an answer on June 15, 2026 at 12:20 pm

    Are you certain that the UISearchBar is frontmost? Try bringing it all the way to the front in code, in your viewDidLoad. If that doesn’t work to solve the glitch, consider an alternative solution to your interface. Here are some – try any one of them:

    • Make the UISearchBar the header for the UITableView (not a section; the table view itself). This is very standard interface.

    • If you are on iOS 6, instead of the scroll view delegate trick (which was quite standard before iOS 6, well done), use constraints to pin the search bar to a view higher up the view hierarchy than the table view. (Since you are in a navigation controller, that would be the navigation controller’s view in your case.) That’s the new iOS 6 way to prevent a scroll view subview from being scrolled with the content. I do not know if that will solve the glitch but it could be worth a try.

    • Don’t use the default separator. It is not difficult to draw your own separator as part of the cell background image.

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

Sidebar

Related Questions

I have a flowpanel that I'm dynamically adding usercontrols to. I want it to
I'm dynamically adding rows/fields in this code. I have a text field for the
I have a UIButton that I'm adding dynamically using content parsed from an XML
I have a UITableView that I am adding dynamically via a initWithFrame. - (void)twitterUpdate
I'm adding dynamically created EditTexts to a layout (onClick button method). When I rotate
I'm dynamically adding a custom user control to the page as per this post
I have a list in which I am dynamically adding the classname, now when
I have a FragmentActivity where I'm dynamically adding Fragment s in my onCreate .
In my app i have a ListView which dynamically increases by adding 10 items
I'm dynamically adding a h:selectOneMenu to the page. But the listener method for f:ajax

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.