UISearchDisplayController - can see content scrolling behind it - ios

I've got a UISearchDisplayController which displays search results in a UITableView that's right below it.
Everything works ok, I'm able to populate the tableview on the UISearchDisplayController, but when I scroll the tableview, the contents of the tableview are shown scrolling up behind the UISearchBar under the status bar of the device.
Has anyone got any experience of how to prevent this from being shown? All of my other view controllers I'm setting the navigation bar to have a specific colour, but on this search controller it doesn't take effect.

This is a known problem if you are using the UISearchDisplayController in a uipopover
I have the same problem and a lot of solutions provided by others do not work. I am actually quiet close to nailing it now. It is all about doing a notification to handle the keyboard hide and setting up the search results tableview content size

Related

Scrolling effect in ViewController

How can I achieve when the user scrolls in the ViewController down to make the highlighted text show up in NavigationBar and when the user scrolls back up to make it disappear again? Similar to Apple's one in Settings app in Apple advertising (https://imgur.com/0FeFJ3s)
Edit:
Looking at the image you posted, this seems to be the default transition a large style navigation bar gives you. The only tweak that's been done is centering the title text.
Original answer:
The text in the navigation bar follows the .title property of your view controller. However, setting the title is not animated. Depending on your use case, that may or may not be enough.
If you want to do things a bit more fancy, you have some control over the .navigationItem.titleView in a view controller. This way you can use a custom view in the navigation bar. Using this, and a bit of fancy programming, you can animate things there.
Last, you can read the scroll position of a UITableView or a UIScrollView by implementing the scroll view's delegate's scrollViewDidScroll method. How you know where the labels that are interesting are depends on the content of your scrollView, so I can't answer that for you.

ios11 Attach custom view below UISearchController UISearchBar that hides with the Searchbar

I had a UISearchBar with which i attached a custom view below which gave some buttons for filtering and sorting... now i want to use the ios11 UISearchControllerthat provides a searchbar which smoothly hides into the top NavigationBar. I looked around some and tested a few things but cant figure it out properly. The custom view should hide when scrolling up as well.
Any tips or anything i can read up to get a hold on this? (I'm relatively new to ios development)

Search bar partially disappears when switching views in iOS 7

We have a UISearchBar backed by a UISearchDisplayController in our app. Changing screens with the search bar hidden partway under the header causes that portion of the bar to be gone when the user returns, revealing the search bar's background. Here, I have it set to red which shows me that the search frame size and position are still correct.
Tapping anywhere inside the bar brings up the keyboard as expected. However, once the bar moves to the top of the screen, the part that was hidden stops responding to input. This blocks text selection and taps to the top of the Cancel button.
I have experimented with all of the answers in this question without success, so I think our issue is different, though likely related. Does anyone know what's going on, and how we can fix it? Thanks for your input.
If you are running on iOS 7.0 version then you need to set following property which is newly introduced in iOS 7.0 as follows
self.edgesForExtendedLayout = UIRectEdgeNone;
as by default edgesForExtendedLayout property is set to UIRectEdgeAll that means the view controllers use full-screen layout by default. And your's searchbar appeared to be rendered behind the navigation bar, starting from navigation bar offset.

UIPopoverController passthroughViews ignoring Z-index and hierarchy?

With iOS7 tables has extended edges that lies under navigation bar, tabbar, etc. When I presenting UIPopoverController from one of cells of that table and set that table in the passthroughViews, it causes possible to tap on the cell under navigation bar, toolbar, tabbar, whatever! Even if bars are upper than tableview.
When I confronted this with UISearchBar, I've set up passthroughViews like that
#[self.searchBar, self.tableView]
(no matter that searchbar is in tableHeaderView) and everything was working fine (I thought). But now I know it's definitely an unexpected behaviour, possibly a bug in Cocoa Touch.
Have anyone solved this?

UISearchDisplayController on iOS7

I'm having a very annoing problem on iOS7. I have a VC with different subviews, one is a tableview that is display fullscreen after pressing a button. This tableview has a search bar with a scope bar in its header that is linked to a search display controller.
On iOS 6 everything runs fine, when I press on the search bar the scope bar is displayed and the rows correctly slide at the bottom as you can see in the images (forget about the big X).
On iOS7 I have a problem.
Everything seems OK(and it's under the status but I know how to fix that).
But when I start a search the layout change leaving some blank space at the top, this doesn't happen on iOS6.
How can I solve that? where this problem comes from?
Andrea
It looks like your search results are pushed down by the status bar height. Try fixing your header position (so it's not under the status bar) and see if that works. If not, you'll need to share some code to show how your layouts are constructed.

Resources