(left: number, top: number, right: number, bottom: number, setFrame = true)
| 115 | |
| 116 | @profile |
| 117 | public layout(left: number, top: number, right: number, bottom: number, setFrame = true): void { |
| 118 | const { boundsChanged, sizeChanged } = this._setCurrentLayoutBounds(left, top, right, bottom); |
| 119 | |
| 120 | if (setFrame) { |
| 121 | this.layoutNativeView(left, top, right, bottom); |
| 122 | } |
| 123 | |
| 124 | const needsLayout = boundsChanged || this.isLayoutRequired; |
| 125 | if (needsLayout) { |
| 126 | let position: Position; |
| 127 | |
| 128 | if (this.nativeViewProtected && SDK_VERSION > 10) { |
| 129 | // on iOS 11+ it is possible to have a changed layout frame due to safe area insets |
| 130 | // get the frame and adjust the position, so that onLayout works correctly |
| 131 | position = IOSHelper.getPositionFromFrame(this.nativeViewProtected.frame); |
| 132 | } else { |
| 133 | position = { left, top, right, bottom }; |
| 134 | } |
| 135 | |
| 136 | this.onLayout(position.left, position.top, position.right, position.bottom); |
| 137 | this._privateFlags &= ~PFLAG_LAYOUT_REQUIRED; |
| 138 | } |
| 139 | |
| 140 | this.updateBackground(sizeChanged, needsLayout); |
| 141 | this._privateFlags &= ~PFLAG_FORCE_LAYOUT; |
| 142 | } |
| 143 | |
| 144 | private updateBackground(sizeChanged: boolean, needsLayout: boolean): void { |
| 145 | if (sizeChanged) { |
no test coverage detected