Reputation: 53
I have a UISearchBar
in an iPad app. When the search bar begins editing, I show a popover below the search bar containing search suggestions and previous searches:
This is a long-standing interaction in the app. Now under iOS 7, everything behind the popover (in terms of z-axis) looks dimmed — presumably, the UIView
the popover adds over the top of the window is no longer transparent. This means the search bar that the user is currently editing in looks like it's no longer active. It is still active (the user can still select text in the search bar and tap the Delete button to clear the search bar's text), but it bugs me a bit that it looks like it's inactive.
What are my options for dealing with this change in how popovers work in iOS 7?
Here's what I've come up with so far:
UIPopoverController
, so I imagine it would involve digging around and finding the popover's window)UIPopoverController
and try mimicking it with my own view controller that dims everything but the search barAm I missing something obvious? Both options (and the other dumb/crazy options I thought about) seem nontrivial to implement and/or bad ideas for a few different reasons.
Apple's sample project for demonstrating this kind of functionality, ToolbarSearch, exhibits the same behaviour as my app. This dimmed-out search bar can't be the best experience for users. By way of example, consider Calendar for iPad: it went from having a search bar in the navigation bar that shows a popover beneath it when it's active (just like my app) to just showing a search icon that shows a popover containing a search bar. I imagine the change was made because of the problem I've run into here.
Upvotes: 1
Views: 2661
Reputation: 3785
In my opinion, the easiest and most user friendly thing to do would be to move the search bar into the UIPopover
. To remove the dim you are going to have to write your own UIPopoverBackgroundView
. If you want to see how to do it, take a look here.
Upvotes: 1