[NT-1240] Prevent UIStackViews from inheriting margins #1192
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
π² 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
tofalse
.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 tofalse
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
β Acceptance criteria