How To Avoid iOS Blue Location NavigationBar Messing Up My StatusBar? - ios

iOS has a feature that (I'm using both iOS 10 and 11) when you use a location-based app, say Waze, and you put that app on the background, there will be a blue navigation bar with a blue status bar background saying that Waze is currently using your location. Then open up your own project and close the Waze, this will happen.
Any idea how to fix this one? I'm guessing some configuration in the AppDelegate. Something to setup upon making your project active. I've tried the same steps in my other project and I have no idea why does that other project handle it a little better. The other project has a readable status bar but different background color, still quite a mess but better than in this project in the photo.

This is how your app should work:
The status bar is transparent.
Your view controller's main view should underlap the status bar; it should be fullscreen.
Your views should use autolayout to respond to changes in the size of the top bars (they should be pinned to the top layout guide or, in iOS 11, the top of the safe area).
You are not doing that correctly, so your app does not behave correctly when the status bar size changes due to the location manager bar. You probably have the same problem with phone calls coming in. You can easily test in the Simulator by choosing Toggle In-Call Status Bar.

Related

Swift: how to switch statusbar orientation in IOS 9+?

I'm building a game that is based on gestures. IOS' native gestures that bring in notification center and control center on side swipe are super annoying as they interfere with gameplay.
Having searched extensively for a solution, I have come to belive that there is no way to disable/block control center or notification center on app level.
One possible solution that could help that I found was to turn the status bar orientation. My app runs in landscape orientation. If I could switch notification/control centers from top and bottom swipe to left and right swipes, I think that could almoast solve my problem.
However this seems to be possible but depreceted since IOS 9: https://developer.apple.com/documentation/uikit/uiapplication/1622939-setstatusbarorientation?language=objc
Apple suggests to use UITraitCollection instead. However I can't figure out how to change the orientation of the status bar using this. Sample code would be greatly appreciated!
From the same documentation it states:
you should not arbitrarily set status-bar orientation using this
method
This is even more true now because if you do try to use this method you get this warning (and it didn't actually work):
'setStatusBarOrientation(_:animated:)' was deprecated in iOS 9.0:
Explicit setting of the status bar orientation is more limited in iOS
6.0 and later
This is not something you should be trying to do with your app. Either hide the status bar or leave it at the top.

iOS 11: `UIBarButtonItem`s having placement and usage issues

We have an app that has been around since before the days of storyboards. Prior to iOS 11 everything was fine after we updated it to be 64 bit. We have found two issues when running under iOS 11:
On iPhones the single UIBarButtonItem in the navigation bar's RightBarButtonItems isn't being placed all the way to the right as usual (the left side buttons is in the proper position).
On iPads we have what looks much like a segmented control (but made of individual buttons). It works fine when it is not in any kind of bar, but when it is in a bar it doesn't get touches.
In both cases I have used the UI navigator in Xcode to see that iOS 11 has added a couple extra views between bars and buttons. One of the added views is a bar content view (specific class depends on wether it is a toolbar or navigation bar; _UIToolbarContentView or _UINavigationBarContentView). The other added view is consistent among all kinds of bars, _UIButtonBarStackView.
In issue 1 above the added stack view is adding a very wide zero height view after the right bar button that is pushing the button way to the left (like it is trying to fit on an iPhone 4's screen far). Since the class has an underscore in front of it and isn't listed in the docs it must be a private class so even if I did dig into it and figure out how to keep the extra padding from getting added to the end it would get rejected by Apple for using private API.
I can't be sure what of the new views is intercepting the touches for the second issue but given that they are the only real differences I see between iOS 10 & 11 they seem the most likely culprits.
As I mentioned this was built before storyboards so the UI is built in xib files.
Has anyone run into issues with these new views and found a way to solve them? Or should I just rip out the whole UI and rebuild it?

Auto adjust layouts after restoring iOS status bar

After initially designing my UIViewControllers in storyboard without a status bar, I have been instructed that we need to put them back in. Now all the layouts overlap the status bar. Is there an easy way to have everything automatically adjust to start with y=0 below the status bar? Moving and re-pinning everything to the top layer guide is going to be both tedious and error prone - seems like it should happen automatically.
I am using Xcode 6.1, targeting iOS 7.1 and later.
I think there is just one way to make a script to rewrite Storyboard XML file. You try to change constraints for one ViewController manually and check the difference.

how to cover ios' baterry&time bar under my AIR app

I use flash builder to develop a game bases on AIR, but here are the question: my app's top position covered by ios' battery&time bar, so I cant click those buttons on the top position. How to resolve this question by using AS3.0 or some other methods?
You can hide the Device's notification bar at compile time by setting <fullScreen>true</fullScreen> in your myApp-app.xml descriptor file, you cannot control this at run time though.

Is this the right way to make an iPad app full screen?

I want to disable the status bar in iOS to make my app full-screen. I managed it but I'm not sure I did it correctly.
Here's what I did:
In IB, set the Simulated Metric for Status Bar to None
Added an entry in the Info.plist UIStatusBarHidden = YES
Moved my views around in IB so they fill the screen.
I'm not using OpenGL or anything like that, it's just a straightforward Cocoa Touch app which, like many others of a similar type, benefits from having access to every pixel on the screen.
To my shame I got the technique from one of those omnipresent 'tutorials' that litter the web like the dust bunnies under my bed. It was dated 2009. Is there a more modern, approved technique I should be using instead?
If it helps I'm targeting iOS 5 only.
The statusBarHidden property of the shared UIApplication object controls whether the status bar is visible. The UIStatusBarHidden entry in the app's Info.plist sets the value of that statusBarHidden property when the application is launched. You can change the property's value to hide or show the status bar while your app is running.
These are the current methods for controlling the status bar's visibility as of iOS 5.0.1.

Resources