(nativeView: UIView, frame: CGRect)
| 233 | } |
| 234 | |
| 235 | public _setNativeViewFrame(nativeView: UIView, frame: CGRect): void { |
| 236 | const oldFrame = this._cachedFrame || nativeView.frame; |
| 237 | |
| 238 | if (!CGRectEqualToRect(oldFrame, frame)) { |
| 239 | if (Trace.isEnabled()) { |
| 240 | Trace.write(this + ' :_setNativeViewFrame: ' + JSON.stringify(IOSHelper.getPositionFromFrame(frame)), Trace.categories.Layout); |
| 241 | } |
| 242 | |
| 243 | this._cachedFrame = frame; |
| 244 | this._modifyNativeViewFrame(nativeView, frame); |
| 245 | |
| 246 | this._raiseLayoutChangedEvent(); |
| 247 | this._isLaidOut = true; |
| 248 | } else if (!this._isLaidOut) { |
| 249 | this._cachedFrame = frame; |
| 250 | |
| 251 | // Rects could be equal on the first layout and an event should be raised. |
| 252 | this._raiseLayoutChangedEvent(); |
| 253 | // But make sure event is raised only once if rects are equal on the first layout as |
| 254 | // this method is called twice with equal rects in landscape mode (vs only once in portrait) |
| 255 | this._isLaidOut = true; |
| 256 | } |
| 257 | } |
| 258 | |
| 259 | get isLayoutValid(): boolean { |
| 260 | if (this.nativeViewProtected) { |
no test coverage detected