Hiding tab bar causes web content in pushed view to slide down
Hiding tab bar causes web content in pushed view to slide down
- Subject: Hiding tab bar causes web content in pushed view to slide down
- From: Rick Mann <email@hidden>
- Date: Thu, 29 Oct 2015 18:14:38 -0700
I have a tab bar application with a nav controller in each of the tabs. Clicking on an item in that pushes a new view controller with a WKWebView. Actually there's a UIView specified in IB, and in -loadView I create the WKWebView and add it to the UIView, and then add constraints to make it be the same size.
Then in -viewDidAppear:, I load the web view content. This works fine.
Now I changed the pushed controller so that it hides the tab bar on push. Now, when the web content loads, there's a gap between the top of it and the bottom of the nav bar (no gap along the bottom). You can see it slide from the right, then snap down. If I skip the load in -viewDidAppear:, I don't see it move, but of course the page is all the same color.
I tried coloring the container view blue and the web view red. The view hierarchy inspector in Xcode does not appear to render the stack correctly (e.g. it shows the web content as completely off to the left).
I finally solved this by a) removing the simulated nav bar in the pushed VC, and b) constraining the container view to the super view, not the top layout guide. I can't tell if this is causing the web content to appear under the nav bar, but that's not particularly critical in this case.
The thing is, I feel like this is a bit of a hacked solution, and don't understand what's going wrong in the first place.
--
Rick Mann
email@hidden
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden