Skip to content

iOS 11: Status bar of the transitioned view is white when using menuAnimationTransformScaleFactor #258

Open
@frenkelor

Description

@frenkelor

New Issue Checklist

I have read the guidelines for contributing and I understand:

  • My issue is happening in the latest version of SideMenu.
    My issue was not solved in the README.
    My issue can not be answered on stackoverflow.com.
    My issue is not a request for new functionality that I am unwilling to build and contribute with a pull request.
    My issue is reproducible in the demo project.

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

screen shot 2017-09-13 at 22 23 00

Activity

jonkykong

jonkykong commented on Sep 13, 2017

@jonkykong
Owner

Thanks for reporting. I'm going to roll this into a pending update for Swift 4 with Xcode 9 once it's officially released.

jonkykong

jonkykong commented on Sep 21, 2017

@jonkykong
Owner

@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 (menuPresentingViewControllerUserInteractionEnabled as well as screen rotation ugliness).

Example work-around, placed inside of your UISideMenuNavigationController subclass:

    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()
    }
frenkelor

frenkelor commented on Sep 21, 2017

@frenkelor
Author

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

jonkykong

jonkykong commented on Sep 21, 2017

@jonkykong
Owner

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.

changed the title Status bar of the transitioned view is white Status bar of the transitioned view is white when using `menuAnimationTransformScaleFactor` on Sep 21, 2017
changed the title Status bar of the transitioned view is white when using `menuAnimationTransformScaleFactor` Status bar of the transitioned view is white when using menuAnimationTransformScaleFactor on Sep 21, 2017
calli23

calli23 commented on Oct 6, 2017

@calli23

After desperate hours of trying to solve this issue I got an answer. Just check off translucent checkbox for navigationBar...that worked for me.

jonkykong

jonkykong commented on Oct 6, 2017

@jonkykong
Owner

@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.

changed the title Status bar of the transitioned view is white when using menuAnimationTransformScaleFactor iOS 11: Status bar of the transitioned view is white when using menuAnimationTransformScaleFactor on Oct 12, 2017

53 remaining items

Loading
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

      Participants

      @kiokumicu@dnosk@kostapappas@jonjardine@frenkelor

      Issue actions

        iOS 11: Status bar of the transitioned view is white when using menuAnimationTransformScaleFactor · Issue #258 · jonkykong/SideMenu