Moved UINavigationBar redraws in wrong location after app becomes active from background - ios

I have a UINavigationBar which is moved upwards (including off-screen) when the scroll view below it scrolls up. When (after pressing the Home Button) the app becomes inactive and is then resumed, the display comes back as it was beforehand, but the navigation bar is redrawn at the default position (below the status bar). When I tap the screen and scroll a minimal amount it jumps into place where it should be (usually off-screen in that case).
Is there anything short of full-blown app-restoration that can be done to rectify this?
The UINavigationBar is shifted by setting its frame. After the app becomes active, I make sure the frame is re-set to the correct size, but it still draws in the 'standard' place.
Needless to say I have already tried a multitude of approaches & forced re-draws, but to no avail. Hiding and then showing it again, calling setNeedsDisplay etc.
(This is on iOS 7)

Related

Focused UITextField loses align and starts flickering when back to foreground

I have UITextField that is a first responder, when appropriate button is pressed application goes to background and opens Phone app. When I get back to my app instead of centre vertical alignment it appears as bottom vertical alignment and it appears/disappears after every second letter is inputed. I tried several solutions, but non of them worked. If I pop the screen, and come back to it again problem is fixed, but after going to background and foreground again this bug appears again.

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.

Any quick solution to make a view appear behind the status bar in iOS 7?

I'm porting my app from iOS 6 to IOS 7 (there will eventually be a complete GUI redesign for iOS 7 but in the meanwhile just getting the existing GUI to display properly on iOS 7 is the goal.
I had the issue where the status bar was overlapping my GUI and so have shifted the Y origin of the view controller's view down by 20.
However my app contains a pulldown which when retracted is overlapping with the status bar. In the screenshot the red is a button which is present in the pulldown view. The grey bar is the top of the main view behind which a portion of pulldown is hiding when retracted.
I implemented the pull down as a fixed size child subview of the main view and when retracted its Y origin is a negative number thus it is effectively still displayed but off the top of the screen. When the user pulls it down I just animate the increase in the Y origin until eventually the origin is 0.
Is there some way I can make the pull down view appear beneath the status bar or some other quick solution?
Note of course I can't simply toggle the pulldown's alpha to display/hide it as it pullsdown obviously thus its appearance/disappearance is not a discreen action. I could maybe attempt to make the portion of it that is on top of the status bar invisible but as its something that is moving that seems like its going to be complicated. Is there any simple solution?
Thanks
Add another view, with a fixed position, under the status bar (with the same color of your grey bar), 20px tall and same width of the status bar, but with a z-index higher than the retracting view. This view will cover the retracting view (but not the status bar) acting as a "background" for the status bar itself. Obviously you have to adjust the Y position of the retracting view to make it tappable by the user (but under the status bar)
iOS 7 by default lets views take up the fullscreen, including the status bar. This is controlled using the UIRectEdgeAll property.
If you want the old style view, set UIRectEdgeNone for self.edgesForExtendedLayout
in viewDidLoad:
self.edgesForExtendedLayout = UIRectEdgeNone;

GLKView frame size animation causes GL to render only a portion of the screen

I have a GLKView contained in a UIView under a top, nav-like bar. The bar can be shown/hidden with an animation and the autolayout pinning causes the views to fill the portion of the screen under the bar (or the full screen if hidden).
What's odd is that when the top bar begins its show/hide animation, the GLKView immediately jumps to the final height. When showing the top bar (which shrinks the GLKView), it causes clear band to be seen on the top and bottom.
What's also odd is that the view's position seems to work correctly, and animates smoothly down as the top bar comes down until they all eventually line up as they should.
Dumping out out the GLKView's layer.presentationLayer property seems to indicate that it's bounds animates correctly.
The GLK-ness of the view could be a red-herring as I haven't tested this on other parts of the app...will do though...
Very confused. Sorry no photos but it's all NDA and I've no time to make a sample project right now. Maybe later if need be. Thanks...

Why are touches not detected at top of screen with status bar hidden?

In our app, we show modal windows that take up the whole screen, and we hide the status bar at this time. However, buttons placed at the top of the screen have reduced hit areas: their tops do not detect touches. This is true of custom buttons and buttons in the navigation controller.
What is preventing detection of those touches?
FYI: I have two other windows, a HUD view and a status bar overlay, and both are hidden. I've tried putting the status bar overlay behind the main window, as well. Problem remains.
Update: This problem is caused, at least in some cases, by hiding the status bar while still having a scroll view with scrollsToTop set to YES. Although I have found a case where the problem remains even after disabling scrollsToTop for all resident scroll views. (I wrote a simple method to walk the view hierarchy to find all scroll views and report their current scrollsToTop setting.)

Resources