mirror of
https://github.com/NativeScript/NativeScript.git
synced 2025-11-05 13:26:48 +08:00
IOS fix for context
This commit is contained in:
@@ -407,7 +407,7 @@ export class ViewBase extends Observable implements ViewBaseDefinition {
|
||||
}
|
||||
|
||||
protected _addViewCore(view: ViewBase, atIndex?: number) {
|
||||
if (this._context) {
|
||||
if (isIOS || this._context) {
|
||||
view._setupUI(this._context, atIndex);
|
||||
}
|
||||
|
||||
@@ -448,7 +448,7 @@ export class ViewBase extends Observable implements ViewBaseDefinition {
|
||||
|
||||
// view.unsetInheritedProperties();
|
||||
|
||||
if (view._context) {
|
||||
if (isIOS || view._context) {
|
||||
view._tearDownUI();
|
||||
}
|
||||
}
|
||||
@@ -478,11 +478,6 @@ export class ViewBase extends Observable implements ViewBaseDefinition {
|
||||
|
||||
this._initNativeView();
|
||||
|
||||
// TODO: Remove this
|
||||
if (this.nativeView && !this.nativeView.getLayoutParams()) {
|
||||
this.nativeView.setLayoutParams(new org.nativescript.widgets.CommonLayoutParams());
|
||||
}
|
||||
|
||||
if (this.parent) {
|
||||
this.parent._addViewToNativeVisualTree(this, atIndex);
|
||||
}
|
||||
|
||||
@@ -19,6 +19,10 @@ export class View extends ViewCommon {
|
||||
private _cachedFrame: CGRect;
|
||||
private _suspendCATransaction = false;
|
||||
|
||||
get _nativeView(): UIView {
|
||||
return this.ios;
|
||||
}
|
||||
|
||||
public _addViewCore(view: ViewCommon, atIndex?: number) {
|
||||
super._addViewCore(view, atIndex);
|
||||
this.requestLayout();
|
||||
|
||||
Reference in New Issue
Block a user