ios - How to prevent status bar disappearing before UIImagePickerController covers the whole screen? -
here's gif showing issue:
when presenting uiimagepickercontroller
this:
self.present(imagepicker, animated: true, completion: nil)
the status bar disappears before image picker full screen.
the issue have status bar disappears in cloud of smoke, navigation bar jumps occupying void left status bar. when uiimagepickercontroller
dismissed, status bar shows in rightful place.
i'm not customizing status bar in way, default.
is there way prevent uistatusbar
disappearing, @ least until uiimagepickercontroller
animation complete?
if want status bar stay @ top of screen, should create custom window , apply animations manually. may help:
var newwindow = uiwindow() let newcontroller = viewcontrollertopresent() var animationduration = 0.4 // or whatever want. // setting newcontroller root of new window. self.window.rootviewcontroller = newcontroller self.window.windowlevel = uiwindowlevelstatusbar self.window.backgroundcolor = .clear self.window.frame = cgrect(x: 0, y: uiscreen.main.bounds.height, width: uiscreen.main.bounds.width, height: uiscreen.main.bounds.height) self.window.ishidden = false uiview.animate(withduration: animationduration) { self.window.frame = cgrect(x: 0, y: 0, width: uiscreen.main.bounds.width, height: uiscreen.main.bounds.height) }
Comments
Post a Comment