UISearchController misplaces UISearchBar - ios

I am using the UISearchController on a modal page to allow a user to search some data. The page uses a table view controller design and the searchBar is in a tableViewCell.
When the user taps on the searchBar, the UISearchController animates the layout to slide the table header to the top of the page and moves the searchbar. However it does not end up in the right place. It does not move sufficiently up.
Anyone have a suggestion on how to help the UISearchController to position the searchBar correctly?
Before tapping the search bar (looks ok)
After tapping the search bar (search bar in wrong place)

Related

SearchBar controller set position after tableview scrolling in swift

Tableview With searchBarController reference of
https://blog.apoorvmote.com/add-uisearchcontroller-to-tableview/
working.
I'll Add search Button for show/hide the search controller. If I can scroll tableview after click the search button at navigation bar show searchController at custom position. After search Button click it should hide from the custom position.
Please, help me

Is there a search bar that shows results in a sub screen in iOS/Swift?

I have a screen with a UITableView. I would like to add to it a search bar (that searches on the internet) and shows the found results in a sub screen. When an item on the sub screen is clicked, I'd like to add it to my table. Is there such a search bar in iOS? I added a paint in order to make things clearer.
UITableViewControllers have a restriction: its main view must be a UITableView that takes up the entire screen space (except for a possible navigation bar at the top, and a toolbar or tab bar at the bottom).
If you want to have other views such as a UISearchBar you must use a UIViewController and add a UITableView and a UISearchBar

UISearchBar covered up when searching

I have a UISearchBar and a UITableView positioned inside the view of a UIViewController. The table itself and the search function are working fine, but there is a problem with how the search results are layered over the top of the search bar. I'm sure there is something I have misconfigured, but being new to iOS development, I cannot figure out exactly what it is.
This is how the UISearchBar and UITableView are currently positioned within the view:
However, when your tap the search bar, the transparent overlay which appears covers it up. I would expect it to only appear below the search bar or perhaps for the search bar to move up?
If you begin to type, the search results appear, but the search bar itself has now been completed covered up:
I have tried the following:
Moving the UISearchBar to the header of the UITableView. The result of this is that, when searching, the search bar is moved to the very top of the view but when the search has finished, it then is positioned way off the the left so only the very right edge of the search bar is visible!
Disabling the Under Top Bars and Under Bottom Bars options under the Extended Edges options for the view controller (options in Xcode Interface Builder). This results in the same problem, except the Tab Bar and Nav Bar are a different colour (see image below, with keyboard hidden):
This view has been built using a Storyboard. Here is the heirarchy for reference (the Scroll View is hidden in all the screenshots as it only appears on the right once a search result has been tapped):

search display controller issue on ios7

It's only happened on iPad,not in iPhone.
I have a search display controller in my listview, under a titlebar(not navigation bar).
It can be displayed correctly, even I don't set self.edgesForExtendedLayout=UIRectEdgeNone.
The issue is:
When I click in the text field of the searchbar, and then click someplace else to hide the keyboard and end the text input, the searchbar will be shown at the top-left corner of the screen.
p.s.My listview is in the middle of the screen.
In one of my modal view, the search bar is under a navigation bar, there is no such issue. But I must set self.edgesForExtendedLayout=UIRectEdgeNone to show the search bar.
Could you give me a hand please?
Thanks a lot.

iPad popover not resizing properly after search keyboard is dismissed

I have a popover that contains a tableview (which is inside a navigation controller) with custom cells and a search bar in the header. Once I enter the search bar the popover shrinks appropriately to make room for the keyboard. Good so far. Once I dismiss the keyboard either by pressing the search button or the dismiss keyboard button, the popover appears to resize a little but does not does return to the full length as I would expect. I've tried all the suggestions to update the popoversize and contentsizeinpopover. They seem to have no effect.
Any thoughts or workarounds?
Thanks,
Rob

Resources