Why SearchBar of Search Display Controller is not moving up in iOS7? - ios

On my UIViewController, I took UISearchDisplayController and UITableView. The SearchBar of UISearchDisplayController is outside of UITableView because I don't want to scroll SearchBar with TableView. When started typing some text, It looks fine in iOS6 but in iOS7 SearchBar does not move up and tableView comes over it. And after search button clicked, SearchBar goes out of screen and whole screen messed up. Why is this happening?
Image:

I don't know if this problem is stil up to date, but maybe someone will have the same question. The reason of this is that You are using UIViewController instead of UITableViewController.
If it makes no difference to You, use the UITableViewController. If You have some reasons, you'll have to move searchbar programatically in searchBarShouldBeginEditing:searchBar
and searchBarShouldEndEditing:searchBar
Here's an example how: https://stackoverflow.com/a/8042790/1293285

Related

SearchController issue in UITableview

In my code i added UISearchController as UITableView Header.
But if User scroll UItableview then searcher is goes up & hide.
I want to show UISearchBar stick to top.
I don't want to add it in navigation title.
I also try to add in UIViewController but it is disappear when try to search something.
Please help me to solve this.
Thank you,
Don't put the UISearchBar in the header of the UITableView. Put it outside the UITableView. It just means that your view controller will have to subclass UIViewController instead of UITableViewController.

My UITableView Gets ShiftedDown

I have a UITableView that when first displayed it displays correctly with the first row appearing on top. When I select a cell another UITableView is presented. If I used the back button on the UINavigation Bar the original UITableView is shifted down with a blank space between the UINavigation Bar and the UITableView.
I am not using story boards. I am using XIB files. I am also using a sliding menu that I got the code for from Ray Wenderlich's web site.
When I slide back the main screen over the first UITableView it goes back to its proper position. But then when I select an entry again the issue described above appears.
I found another post that seems to provide an answer to the issue. This post says to make some adjustments like to the translucent settings or the auto-layout settings but doesn't give specifics.
Here is that post: Container View getting pushed down as if it had a UINavigationBar?
Thanks,
Glenn
Add
self.automaticallyAdjustsScrollViewInsets = NO;
in viewDidLoad, of the UIViewController where you have the shifting table view

Hide normal UITableView when using Search Display Controller

Both my UITableView and searchResultsTableView have a clear background color. How can I hide the normal UITableView when I'm typing into the search bar of the searchResultsTableView? I've tried hiding tableView, but it hides both tableviews. See my interface builder setup below:
I've also read the post here:
Hide UITableView when searchResultsTableView displayed
However, my Search Display Controller is not being added to the tableview, only the Search Bar is. So I'm not sure how to fix this issue.
Any help is appreciated. Thanks!
You can use the method [subView removeFromSuperview] in this case. Whenever there is a need to display the searchResultsTableView just remove the UITableView from the superview and add the searchResultsTableView in place of that by using method [self addSubview:searchResultsTableView]

Using UISearchDisplayController in a child controller

I made a tabbed controller where the tabs are on top. Underneath the tabs I have a subview which will contain a tableViewController as a child controller.
The tableViewController has a searchBar and a UISearchDisplayController. The problem is, when the search is activated, the UISearchDisplayController jutts out above the frame of the tableView and covers a bit of the tabs.
I believe this is caused by the SearchBar expanding itself on top to cover up the navigationBar.
Sorry but, why are you using a search display controller?
In this case is easier if you use just a tableView with a searchBar as well as your tab.
Then you can develop the same behaviour of the searchDisplayController.
There are developers that have never used the searchDisplayController. In general i use that just when i have a tableViewController within so just a tableView and a searchBar. But in your case, i would not use that. Take your life easier trust me ;)

iOS UISearchbar in UIToolbar, show search result not popover in iPad

I'm use iPad UISearchbar embed in UIToolbar, the search result will show in the UIPopover
but use iPhone, it's show in same table view
I want to search result show in the same table view, How can I do?
Thank You!
I had the issue too. What I do to fix it is instead of adding a UISearchBar in the UIToolBar via a UIBarButtomItem, I added the UISearchBar in a view (normal UIView) and added that view in the toolbar via the UIBarButtomItem. See the image below.
I don't know why, but this fix the issue.
Reload the TableView with Sorted items. Thats it.

Resources