InteractiveSideMenu
InteractiveSideMenu copied to clipboard
Status bar vanishes when loading a menu item inside a navigation controller
When I create my menu item controllers, I embed them in navigation controllers.
e.g.
let text = TextViewController(textView: TextView.init(frame: UIScreen.main.bounds), pageID: page.pageid) let navigationController = UINavigationController(rootViewController: text) contentList.append(navigationController)
Issue is when I click one of these items, it loads, but the status bar vanishes and just leaves a black box.
How can i get the behaviour to work as expected and retain the status bar which then takes on the background colour of the navigation bar, as it would do outside of the side menu encapsulation
Hi @jackdem,
What preferred status bar color do you have, when menu items are loaded? It could be a situation, when you have default
(darkContent) and dark background.
If you have another case, please, add screenshots and more details about your case.
Thank you for your question.
Hi there, my appearance config looks like this:
UINavigationBar.appearance().tintColor = UIColor.white UINavigationBar.appearance().barTintColor = UIColor().appThemeColour() UINavigationBar.appearance().isTranslucent = false UINavigationBar.appearance().shadowImage = UIImage() UINavigationBar.appearance().titleTextAttributes = [NSForegroundColorAttributeName : UIColor.white] UIApplication.shared.statusBarStyle = .lightContent
I made a stack overflow post on the topic with a bit more detail if it helps:
https://stackoverflow.com/questions/46586451/navigationbar-not-filling-under-status-bar-when-clicked-from-side-menu
Is it reproduced on iOS 11 only or on all versions?
im not sure how to confirm older versions as im only working with 11
In Xcode you can click on Active Scheme and then Download Simulators and choose version before 11 to download.
Also, this Stack Overflow question should help you.
I downloaded iOS 10.0 simulators and it seems to work fine, so its iOS11, is there a fix / solution possible? as currently its not really usable in iOS11 with this behaviour in my use case
I'll take a look into your issue today. To simplify this work, please, try to reproduce the issue on the sample or send me your code.
Also, did you test it on a real device? Or simulator only?
Simulator only, i dont have any iOS10 devices.
I cant provide a sample sorry, but the setup is simply, the sidemenu and then clicking an item loads a navigation controller with a viewcontroller assigned to it. This view controller will suffer the black bar issue as the nav bar header doesnt extend up behind the status bar. If you drag the view controller to open the menu then very slowly move it backward closing the menu, you can get the black bar to dissapear for that run of the app. So it seems perhaps its to do with the animation of the open/close vs the navigation bar in iOS11 that causes it
Hi was there a solution found to this? ive been running my app on iOS10 simulator for a while now but i cant do a public release unless there is a work around, would be much appreciated
Hi @jackdem ,
It looks like CGAffineTransform(scaleX, y)
of ViewController's view works not correctly with NavigationBar in iOS 11. I'm going to report a bug to Apple.
You can use contentScale = 1
for iOS 11 users for now until this issue will not be fixed or we'll find some workaround.
Please, let me know if SideMenu works for your case without content scale.
thanks, sorry for the simple question, but where do i set the contentScale?
Using transitionOptions.contentScale = 1
https://github.com/handsomecode/InteractiveSideMenu#animation-customization
unfortunately this didnt fix it, the status bar remains the wrong colour in an iOS11 simulator
Please, attach the recording. I can't reproduce your issue with contentScale
equal to 1.
sorry i set it in the viewwilltransition, moved it to the viewdidload and now its fine, no issue. i just loose the nice animation. Is this something that should resolve in the longer term?
It will depend on Apple's answer
I have the same issue, I hope Apple answers soon :)
if #available(iOS 11.0, *) { transitionOptions.contentScale = 1 }
Your workaround is working btw!
Hi, I have a similar issue but with my project, the navigation bar does not show up at all. Is it possible to get a sample of how to implement this menu with navigation controllers? The side menu works fine but the navigation bar does not show up for any of the view controllers. Also, using a side menu with multiple sections in the table, how do I access other sections to display the right view controllers? I have been at this for weeks!
Hey, I just saw it worked with the IPhone SE. So it also have something to do with the size of the screen on IOS 11.
The workaround is not proper, if you use the gesture navigation to slowly open and/or slowly close the side menu, the white status bar is displayed and it vanishes when the view takes up the full space.