1

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.

enter image description here

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.

Glenn Posadas
  • 12,555
  • 6
  • 54
  • 95

1 Answers1

1

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.

matt
  • 515,959
  • 87
  • 875
  • 1,141
  • Thanks, Matt. Of course I'm using autolayout since I started my career in iOS. Anyways, what helped me from this answer is the idea of the `In-call status bar`. I have another project (all UI are made programmatically( that does handle perfectly whatever I do in the status bar, like toggling in-call status bar, location, and hotspot. I have no idea why this particular app (using storyboards) can't handle the status bar changes properly. – Glenn Posadas Sep 11 '17 at 15:00
  • Very cool. I feel in my bones that my list covers the problem, but if not, it will be great if you give your own answer when you figure it out. By the way, you can use the View Debugger to figure out why your views are positioned as they are. – matt Sep 11 '17 at 15:05
  • Alright. So what I've done so far is to test my past projects and they handle the statusbar/navigationbar changes by the call/hotspot/location of the iOS. I think it's in the library I'm using called `CosmicMind's Material` or it's in the Storyboard configuration. Thanks. I'll select this as answer or I'll share one if none of these is the solution. – Glenn Posadas Sep 12 '17 at 06:55
  • Hi matt, I've solved the problem after a couple of days. :) https://stackoverflow.com/a/46203868/3231194 ... I'm selecting this as answer as a thank you for the effort lol. I think you can edit your answer and inform the future visitor of this question to check how they're presenting their screens. – Glenn Posadas Sep 13 '17 at 17:47
  • 1
    Well, my answer was right: your view controller should be fullscreen. Isn't that what the problem was? – matt Sep 13 '17 at 18:03
  • oh, yes yes. I actually read your answer twice but maybe didn't fully understand. :D Maybe you should have told me to check my presentationStyle ✌️Thanks. – Glenn Posadas Sep 13 '17 at 18:18
  • Maybe _you_ should have told _me_ that you were presenting a view controller. You never mentioned that in your question. You didn't mention _any_ specifics in your question. You see, if you leave out all the relevant facts about the view controller that's giving you trouble, one can reply only with general guidelines. That's what I did, and indeed it turns out that you were not following those guidelines. – matt Sep 13 '17 at 18:27