-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
SnackbarController fails to layout its rootViewController's height correctly #612
Comments
When I comment out (RootController.swift : 129) viewController.view.frame = rootViewController.view.frame the SnackbarController's view doesn't get larger when changing view controllers. But it's still too large. |
I will take a look :) |
Is the issue that your views are behind the TabBarController ? If so, this is not actually a edgesForExtendedLayout = [] |
The issue is, that the rootViewController of my SnackbarController has always the wrong height. And the height gets increased by 138 every time I change the rootViewController using .transition() |
I understand that. The frame doesn't get increased by any factor, rather it is made the same as the previous that is being transitioned from. viewController.view.frame = rootViewController.view.frame If you can share a sample that replicates this, that would be great. You are placing this inside a This is where a sample project that replicates the issue would be very helpful. |
I'll make one! :) |
:) Thank you! |
And here is an example project. See AppDelegate.swift, line 41 |
I will take a look tomorrow :) |
Looking at this now :) |
Very nice, thank you! |
So it all works :) I don't think you were showing the snackbar. Add this: The Snackbar is hidden by default. |
The snackbar is not the problem. The problem is the snackbarController laying out its subviews (see the images above) |
The first "Hello" should be centered, too, but it isn't. It's an UILabel as a TableView's backgroundView. And the TableView is inside a SnackbarController. If I put the TableView into another Controller, let's say a PageTabBarController (image #2), it is centered. |
Fixed the issue :) Will make a release momentarily. |
Please update to Material 2.3.21 :) It should be aligning correctly now. Thanks for catching this issue. |
Wow, nice! Thank You! :-) |
Yes, it works! Thanks! :-) |
My setup is:
I'm changing my view controllers by calling
.transition(to: targetViewController)
on the SnackbarController.The problem I have is that my view controllers have the wrong height.
I've debugged some bounds:
The output was:
And it even becomes more weird: If change my view controller using .transition, the new view controller's height increases by 138 everytime. (It's 138 on all devices)
So if I change my view controller, it outputs:
And if I change it again, it outputs:
Maybe you can take a look...
Thanks!
The text was updated successfully, but these errors were encountered: