mirror of
https://github.com/NativeScript/NativeScript.git
synced 2025-08-26 03:01:51 +08:00
Moved delegate handling to onLoaded / onUnloaded methods and reworked the WebView tests.
This commit is contained in:
@ -148,7 +148,7 @@ function onSeparatorColorPropertyChanged(data: dependencyObservable.PropertyChan
|
||||
export class ListView extends common.ListView {
|
||||
private _ios: UITableView;
|
||||
private _dataSource;
|
||||
private _uiTableViewDelegate;
|
||||
private _delegate;
|
||||
private _heights: Array<number>;
|
||||
private _preparingCell: boolean = false;
|
||||
|
||||
@ -165,12 +165,21 @@ export class ListView extends common.ListView {
|
||||
this._dataSource = dataSource;
|
||||
this._ios.dataSource = this._dataSource;
|
||||
|
||||
this._uiTableViewDelegate = UITableViewDelegateImpl.new().initWithOwner(this);
|
||||
this._delegate = UITableViewDelegateImpl.new().initWithOwner(this);
|
||||
|
||||
this._ios.delegate = this._uiTableViewDelegate;
|
||||
this._heights = new Array<number>();
|
||||
}
|
||||
|
||||
public onLoaded() {
|
||||
super.onLoaded();
|
||||
this._ios.delegate = this._delegate;
|
||||
}
|
||||
|
||||
public onUnloaded() {
|
||||
this._ios.delegate = null;
|
||||
super.onUnloaded();
|
||||
}
|
||||
|
||||
get ios(): UITableView {
|
||||
return this._ios;
|
||||
}
|
||||
|
Reference in New Issue
Block a user