Note that there are some explanatory texts on larger screens.

plurals
  1. POWhy UISearchBar and its scope buttons are shown in one line?
    primarykey
    data
    text
    <p>I have seen Apple's example "TableSearch" that when touched its scope buttons come below the search bar. <a href="http://developer.apple.com/iphone/library/samplecode/TableSearch/Introduction/Intro.html" rel="noreferrer">http://developer.apple.com/iphone/library/samplecode/TableSearch/Introduction/Intro.html</a></p> <p>But when I make my own it looks good at first but when I touch it looks like ugly, scope buttons and search bar are shown in the same line like this: <a href="http://cl.ly/BN9" rel="noreferrer">http://cl.ly/BN9</a></p> <p>What do I have to do make it like "TableSearch" example in the iPad?</p> <p>I am doing everything in IB and tried to modify the search bar programatically from the controller:</p> <pre><code> - (void)viewDidLoad { [super viewDidLoad]; self.tableView.rowHeight = 88.0f; self.tableView.contentOffset = CGPointMake(0, self.searchDisplayController.searchBar.frame.size.height); self.searchDisplayController.searchResultsTableView.rowHeight = self.tableView.rowHeight; //BELOW DID NOT WORK: CGRect b = self.searchDisplayController.searchBar.bounds; self.searchDisplayController.searchBar.bounds = CGRectMake(b.origin.x, b.origin.y, b.size.width, self.tableView.rowHeight); b = self.searchDisplayController.searchBar.frame; self.searchDisplayController.searchBar.frame = CGRectMake(b.origin.x, b.origin.y, b.size.width, self.tableView.rowHeight); //BELOW WORKS PERFECT BUT IS A PRIVATE METHOD, HENCE I AM NOT SUPPOSED TO USE IT //[self.searchDisplayController.searchBar setCombinesLandscapeBars:NO]; } </code></pre> <p>Thanks in advance.</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.
 

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