Skip to content
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

[NT-1240] Prevent UIStackViews from inheriting margins #1192

Merged
merged 6 commits into from
May 13, 2020

Conversation

justinswart
Copy link
Contributor

πŸ“² What

Fixes some layout bugs in PledgeViewController when presented in landscape and on iPhone SE.

πŸ€” Why

After some extensive trial and error by myself in #1187 and some further thorough investigation by @ifbarrera we were able to determine that, when a view controller is added as a child of another view controller, it may receive additional layout margins from the safe area insets if its view appears either fully or partially outside of the safe area.

πŸ›  How

The mitigation for this appears to be to set the property insetsLayoutMarginsFromSafeArea to false.

Note: While this fixes the primary layout bug that we were observing (cells completely broken), I have found that, in landscape, the cells still receive additional insets on the left and right. It's possible that another view in the hierarchy needs insetsLayoutMarginsFromSafeArea to be set to false but I have tried setting this on the table view, cells, cell content views, etc. without success.

πŸ‘€ See

https://developer.apple.com/documentation/uikit/uiview/positioning_content_relative_to_the_safe_area
https://developer.apple.com/documentation/uikit/uiview/2891101-insetslayoutmarginsfromsafearea

Before πŸ› After πŸ¦‹ Often πŸ€·β€β™‚οΈ
image image image

βœ… Acceptance criteria

  • Satisfiably solves the UI problem

@justinswart justinswart merged commit 44b3cf5 into master May 13, 2020
@justinswart justinswart deleted the NT-1240-payment-method-layout-bugs branch May 13, 2020 18:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants