Note that there are some explanatory texts on larger screens.

plurals
  1. PO(iPhone/iOS) UISearchBar Scope Buttons cover first row of UITableView
    primarykey
    data
    text
    <p>I know this question has been asked before, but I have yet to find a true solution. I have a <code>UITableView</code> with a <code>UISearchBar</code> as its <code>tableHeaderView.</code> Whenever the scope buttons appear, they cover the first row of the <code>UITableView</code>. </p> <p>I have tried using <code>UITableView.contentOffset</code> to offset the <code>UITableView</code> by the height of the scope buttons, and this works until the user taps the <code>UITableView</code> or scrolls it, at which point the <code>UITableView</code> jumps back to its original offset.</p> <p>The best I've been able to do is set the <code>UISearchBar</code> as a separate item in the view, and simply resize the <code>UITableView</code> dynamically to show or hide it when the user taps a search button. The only problem is that there is no animation, so the transition is sharp. </p> <p>UPDATE: I solved the problem by implementing a <code>UISearchDisplayController</code>, as this was the cleanest and easiest solution to work with. The <code>UISearchDisplayController</code> automatically shows/hides the scope buttons and moves the <code>UITableView</code> down accordingly. I didn't do this at first because I wanted the <code>UITableView</code> to remain visible rather than initially being blacked out by the <code>UISearchDisplayController</code>, however I've come to realize that the blackout does not hinder any functionality; the user would not have initiated a search if he wanted to continue looking at the <code>UITableView</code> the way it was.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload