Reputation: 1436
I have used a losing view before and wanted to find out how can I show it in place of the status bar the way the app pocket does it. They seem to temporarily hide the status bar during the download of an article and show a loading view overlaid over the nav bar.
Does anyone know how to actually overlay the loading bar over the nav bar that way?? Hiding the status bar is the easy part of the problem.
See image for reference.
Upvotes: 1
Views: 756
Reputation: 437412
In their case, the navigation bar does not appear to be a standard UINavigationController
, so there's a good chance that just have their own container view controller container class that serves much like a navigation bar, and they have built the progress view into that.
You probably don't want to go through of that, so you can use an "container" view. So your first view controller might have progress view and a container view, and that container view has a navigation controller and the first scene of the app:
You can then have that top level "progress view controller" update its progress view and or animate the showing and hiding of the progress bar by animating the changing of the height constraint of the progress view. Or, even easier if child has a navigation controller, just hide the status bar (by implementing prefersStatusBarHidden
that looks at some state property) and unhide the progress view.
That ends up yielding something like:
Or you can not hide the status bar at all, and just reveal progress view underneath it:
There are lots of options here. It just depends upon the desired UX.
Upvotes: 2