UISearchDisplayController on iOS7 - ios

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.

Related

White Bar appearing at bottom of each view controller in storyboard but doesn't affect when ran

In my storyboard view these white bars appeared at the bottom of every view. I can't remember what I did when they appeared, the only thing I can think of was that I tried to add a bar button but then deleted it, so maybe that created some sort of bar. However the bar doesn't show up when running the app in the simulator, it just has a visual in the storyboard.
Does anyone know what it is / why it appeared? and also how can I get rid of it. I got rid of a few by changing the view heights and then changing them back, but when trying to do the same in the first view when I clicked the white bar they all appeared again on every view.
Also, I've noticed some are within the view and some are an extension.
This issue is caused by adding a bar button item and then removing it. The fix is pretty easy though. Go to your storyboard and select the View Controller having the issue.
You will then want to go to the Utility area on the right side of your screen. You will see Bottom Bar = Translucent Toolbar. Change that to None and you're good to go.

Placing a share button over a uiwebview

I have an rss app that I'm working on in xcode and the articles load up in a full screen web view. I need to place a "share" button in the navigation bar but since my uiwebview is full screen it won't show up when I run the app. I even tried cropping the top of the web view lower and placing the button there but still no luck. Here is an example of what I mean:
The share button needs to be on the right side of the navigation bar but i cannot seem to figure out how that make that work.
Thanks in advance
Fist of all, your top navigation bar seems to be missing (judging by your image). Since the nav bar is missing there is no possible way that the share button will be visible. You can do this is the IB or in your code.
For your IB you can move the view controller's 'layer's' so to speak. When you place all the elements down, your VC should look something like this:
On the left hand side we can see what subviews are at the top and which ones are at the bottom.
As we can see here that the UIWebView is at the top of the list, so it'll be at the bottom of the pile. The navigation bars are further down the list so they'll be at the top of the pile. So due to this they'll go over the UIWebView.
The other way to do this is using insertSubview:aboveSubview:. Fist of all you'll add your UIWebView using addSubview: and then add the nav bar using insertSubview:aboveSubview: and finally you'll add your button the someway as you did for the nav bar, but this time you'll be adding the button above the nav bar not the web view.
My best guess is that your forgetting to add another navigation bar to the top of the screen. Hope this helps!!

UISearchDisplayController - can see content scrolling behind it

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

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.

UIScroll View on IOS 7 lingo

okay, my app was built on for iOS 6 until iOS 7 got released and i started making changes to support both versions. Now, i'm having problems with UScrollView and it's constraints on storyboard. when i add a scroll view to my view which has a navigation bar and add a button (or any subview) for say 20 points under the navigation bar, at runtime the subview get's misplaced vertically. it moves downwards in like 60 points. i guess the same size as the navi bar and the status bar combined. So, i was pulling my hair to know how to fix it with constraints and auto layout but i couldn't figure out how. the app sometimes crashes with a certain mix of layouts. However, what i did was to pull the scroll view aside and place the subviews as i want them to look like with navi bar there, then i pulled it back in it's right place (covering the entire view) and when i run the app it all works as expected. now the question what constraints should i add so that it works as expected without doing the whole process aside and then adding it? right now my view looks like this:
As you can see the button is under the navi bar. but when i runt he app it gets under the bar as i want it to. so how can i just add it on story board under the bar and let it stay there? in iOS 6 i used to do it that way without worrying and ios 7 seems like doing this hard on us.

Resources