Open ColdLogical opened 8 years ago
i got the same issues. But i guess i managed to solve it by setting Top Bar = Opaque Navigation Bar
@kohdesmond what do you mean set top bar? On which controller?
@ColdLogical on the storyboard
@kohdesmond Do you mean 'simulated metrics'? How can it affect for the running app?
@psi-gh not quite sure but the simulated metrics affected my auto layout. but it seems to only affect iOS 10 and it might be a "feature" with xcode 8
@ColdLogical does the weird fix works for you?
+1
I have encountered the same issue.
Does anyone know how to fix it?
As ColdLogical mentioned, we can avoid awkward moving by calling below
drawerController.setDrawerState(KYDrawerController.DrawerState.Opened, animated: false)
drawerController.setDrawerState(KYDrawerController.DrawerState.Closed, animated: false)
However, we could see warning also.
To avoid this.
Chage code a little bit
public func setDrawerState(_ state: DrawerState, animated: Bool) {
...
to
public func setDrawerState(_ state: DrawerState, animated: Bool, completion : (() -> ())? = nil) {
..
{ (finished: Bool) -> Void in
..
completion?()
}
And then call like this.
setDrawerState(KYDrawerController.DrawerState.opened, animated: false)
{
self.setDrawerState(KYDrawerController.DrawerState.closed, animated: false
}
You can avoid the warning.
Note, calling:
drawerController.setDrawerState(KYDrawerController.DrawerState.Opened, animated: false)
drawerController.setDrawerState(KYDrawerController.DrawerState.Closed, animated: false)
Can cause an imbalance of calls to beginAppearanceTransition
/endAppearanceTransition
which can cause your app to stop presenting view controllers correctly.
Customising the KYDrawerController
to include a completion handler to 'resolve warnings' as suggested above helps to some degree (doesn't guarantee a balance of above mentioned calls).
The whole idea of opening and closing the drawer with no animation to fix a layout issue is a total hack.
@ykyouhei can you please look into this issue?
On first run of
to open the drawer, the drawer view controller has a slight vertical animation. Presumably, this is from a CGRectZero frame or something similar. Calls to
drawerController.drawerViewController?.loadView()
ordrawerController.drawerViewController?.view.layoutIfNeeded()
before display have no effect.Current workaround is to open and close the drawer without an animation after application has finished launching.
but creates warnings in the debugger