-
-
Notifications
You must be signed in to change notification settings - Fork 694
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
iOS 11: Status bar of the transitioned view is white when using menuAnimationTransformScaleFactor #258
Comments
Thanks for reporting. I'm going to roll this into a pending update for Swift 4 with Xcode 9 once it's officially released. |
@frenkelor best I can tell, this is a regression or change in functionality in iOS 11 that I cannot easily account for. Whenever a navigation bar is not aligned with the window's top, the height is automatically reduced because it's assumed it does not need to allow space for the status bar. A work around is to snapshot the main view controller and overlay the snapshot. I have not added this to the library as it would break existing functionality promises ( Example work-around, placed inside of your private weak var screenshot: UIView?
open override func viewWillAppear(_ animated: Bool) {
super.viewWillAppear(animated)
if let screenshot = presentingViewController?.view.snapshotView(afterScreenUpdates: false) {
presentingViewController?.view.addSubview(screenshot)
self.screenshot = screenshot
}
}
override open func viewWillDisappear(_ animated: Bool) {
super.viewWillDisappear(animated)
screenshot?.removeFromSuperview()
} |
strange thing is after clicking on the transformed view the one in the right somthing happens the view geting refreshed and the white space disappears |
I observed this as well. It appears to update the view based on where the animation will end, not where it begins. Additionally, starting but then cancelling the interactive drag leaves it in the correct state. The fix I stated above is how a lot of other menu controls get away with this problem. If your app only supports portrait layout you should be in the clear, otherwise you'll have to account for rotation or disable rotation while the menu is displayed. |
menuAnimationTransformScaleFactor
menuAnimationTransformScaleFactor
After desperate hours of trying to solve this issue I got an answer. Just check off translucent checkbox for navigationBar...that worked for me. |
@calli23 thanks a ton for that update. I tested this out myself, and while it appears to solve the scrolling jump and white bar, the status bar area still disappears as the main view transforms instantly which isn't smooth. Additionally, some developers might still be wanting to support translucency on the navigation bar, so I can only call this a partial work-around for now. You can also uncheck extending edges under the top bar for the same effect. |
Any update here? |
@dnosk I have not been investigating beyond the initial finds. Have you found a solution? |
@jonkykong No solution found yet, "Just check off translucent checkbox for navigationBar...that worked for me" does not work for us :( |
As I mentioned, you can also uncheck extending edges under the top bar for the same effect. Alternatively, you can use the code snippet to substitute a screenshot. You'll also need to prevent screen rotation while the menu is displayed. |
There is another possibility:
That should do the trick. Some special behavior in case of rotating the device has to be implemented in addition to that workaround. |
@calli23 while that will work, it's probably safer (and less code) to use a snapshot to not have to deal with scrolling area changes. |
|
@kiokumicu what problem does that solve? |
Your screenshot does not make use of |
Thank you so much @kiokumicu I spent hours searching for this solution . |
Hi guys, I seem to have effectively removed this annoying bug from my own custom implementation of a framework similar to this. The issue is with UISafeAreaLayoutGuide, which gets removed when UIWindow detects it is no longer needed for a specific UIViewController, such as here where the view controller gets transformed into a smaller scale thus not in range of the safe area insets. The way I solved it in my own implementation is by adding custom safearea insets, effectively supplementing those that is originally given to us automatically. These area insets is inserted at the beginning of the animation: private func addSafeInsets(forVC vc: UIViewController) { And should be removed as soon as the dismissal animation is started: private func removeSafeInsets(forVC vc: UIViewController) { Now I hope these small snippets can help the code creator of this framework, thus it might not if it is build in an entirely different way than mine. Although im just so happy to have finally solved this issue for myself. |
@EmilsenLind thank you for reporting this. My initial tests do seem to show this can resolve the issue, though more testing needs to be done and I'm concerned that the solution will cause other bugs. |
Update: I've spent a few hours trying to correct for this behavior and am getting very inconsistent results across the following permutations:
I've tried transforming the Rather than submit an incomplete solution and get new bug reports, I have committed my progress on branch #258-Fixes if someone else wants to try resolving it for all of the combinations above. |
just implement UISideMenuNavigationControllerDelegate
}` |
anyone solved this? |
SideMenuManager.default.menuAnimationBackgroundColor = UIColor.clear |
|
Yes @hassan143 i m getting same problem. Is there any solution for this? |
hey guys have you tried to change the content insets.... in the size inspector you could set the "content insets = never" |
|
I can confirm that @sagarsukode's solution works perfectly when testing on an iPhone X. |
thanks for replying me.
…On Mon, Apr 15, 2019, 7:45 PM Jon Jardine ***@***.***> wrote:
I can confirm that @sagarsukode <https://github.com/sagarsukode>'s
solution works perfectly when testing on an iPhone X.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#258 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AkKI9mNMSHopwM0kPyQPC0TTXxbP4mPrks5vhJCIgaJpZM4PWnL->
.
|
I want to remove the Status Bar from Side Menu. How should I do it guys? |
Version 6.0.0 of SideMenu produces many fixes, but still no clear resolution for this problem. Using |
|
This Code worked for me. Hope it helps someone. |
that shows:- 'menuFadeStatusBar' is deprecated: This property has been moved to the SideMenuNavigationController class. |
Use this for Swift 5: |
I am using Swift4:-
when using this :- |
@jonkykong I'm using swift 5 and Xcode 11 |
I've got solution: |
var statusBarFrame: CGRect { Issue: Value of type 'UIWindow.Level' has no member 'statusBarManager' |
This problem is occurs with me my problem is solved by this way: |
Hello guys! Where should I add this code: |
@jonkykong |
Hello, I am pushing view controller on didselect in sidemenu controller but it will push viewcontroller in the sidemenu not in the root controller |
@jonkykong Thank you for the snippet. If landscape mode is not needed it's a good workaround! |
New Issue Checklist
I have read the guidelines for contributing and I understand:
Issue Description
Status bar of the transitioned view is white
see the image below
after clicking on the transitioned view the status bar place take over by the view
The issue is reproduced on Xcode 9 GM
iPhone 7,8,10 simulator
The text was updated successfully, but these errors were encountered: