Thanks to visit codestin.com
Credit goes to github.com

Skip to content
This repository was archived by the owner on Oct 30, 2018. It is now read-only.

Fixed bottom margin#456

Closed
davbeck wants to merge 3 commits into
slackhq:masterfrom
davbeck:master
Closed

Fixed bottom margin#456
davbeck wants to merge 3 commits into
slackhq:masterfrom
davbeck:master

Conversation

@davbeck

@davbeck davbeck commented May 2, 2016

Copy link
Copy Markdown

There were a couple of situations where the bottom text bar could be behind the tab bar related to the view being loaded and laid out before it was in a tab bar controller.

This forces constraints to be updated after any parent view controllers change.

There were a couple of situations where the bottom text bar could be behind the tab bar related to the view being loaded and laid out before it was in a tab bar controller.

This forces constraints to be updated after any parent view controllers change.
@dzenbot

dzenbot commented May 4, 2016

Copy link
Copy Markdown

Could you please explain how to reproduce this bug?

@dzenbot

dzenbot commented May 4, 2016

Copy link
Copy Markdown

When pushing over a UINavigationController stack, I'm seeing a 2-3 pts movement on the layout because of the changes in didMoveToParentViewController:

@davbeck

davbeck commented May 4, 2016

Copy link
Copy Markdown
Author

I will create an example app that reproduces this and maybe refine the solution to fix the movement you're seeing (good catch). It happens if for some reason the view gets loaded before being added to the parent.

davbeck added 2 commits June 10, 2016 13:05
Now instead of updating our bottom margin when we finish moving to a new view controller (which is called often at the end of an animation) we update it in viewWillAppear, which is called late enough that we should have a valid tabBarController but soon enough that the view controller won't be on screen yet.
@davbeck

davbeck commented Jun 10, 2016

Copy link
Copy Markdown
Author

I finally got around to reproducing this cleanly.

  1. Download reproduce-hidden-bar.
  2. Build and run Messenger-Storyboard.
  3. Tap "Show Messages".
  4. After 1 second the detail view is shown with the text bar missing.

I was able to reproduce this by forcing the view to be loaded immediately but waiting a second to actually display it. There are more subtle ways that this can be triggered, for instance during state restoration, but this is the easiest way to reproduce it with the least amount of code.

I was not able to reproduce the pixel movement you mentioned, but I changed to updating the margin in viewWillAppear: instead. It looks like didMoveToParentViewController is sometimes (but not always) called after the view animates in.

@dzenbot

dzenbot commented Jun 10, 2016

Copy link
Copy Markdown

Great @davbeck. Will give it a try soon.
On the meantime, can you check for #448 and see if it fixes it for you?

@bogren

bogren commented Sep 8, 2016

Copy link
Copy Markdown

I have issues with extra space between the tableview, top of viewcontroller and the textview, resolves when tapping the textfield and close again (layout subviews). Also the mentioned fix resolves the issue.

@bogren

bogren commented Sep 8, 2016

Copy link
Copy Markdown

Ah nvm, can be solved the same way as mentioned in David's comment 🎉

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants