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

Skip to content

fix-next: apply ios safe area before transform #6443

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

Merged
merged 2 commits into from
Oct 23, 2018
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 12 additions & 7 deletions tns-core-modules/ui/core/view/view.ios.ts
Original file line number Diff line number Diff line change
Expand Up @@ -160,19 +160,24 @@ export class View extends ViewCommon {
}
this._cachedFrame = frame;
let adjustedFrame = null;
let transform = null;
if (this._hasTransfrom) {
// Always set identity transform before setting frame;
const transform = nativeView.transform;
transform = nativeView.transform;
nativeView.transform = CGAffineTransformIdentity;
nativeView.frame = frame;
nativeView.transform = transform;
} else {
nativeView.frame = frame;
// apply safe area insets only if no transform is in place
adjustedFrame = this.applySafeAreaInsets(frame);
if (adjustedFrame) {
nativeView.frame = adjustedFrame;
}
}

adjustedFrame = this.applySafeAreaInsets(frame);
if (adjustedFrame) {
nativeView.frame = adjustedFrame;
}

if (this._hasTransfrom) {
// re-apply the transform after the frame is adjusted
nativeView.transform = transform;
}

const boundsOrigin = nativeView.bounds.origin;
Expand Down