mirror of
https://github.com/NativeScript/NativeScript.git
synced 2025-08-16 11:42:04 +08:00
fix(tabs-ios): crash when setting tabStripItems through items property (#7548)
This commit is contained in:

committed by
GitHub

parent
46c17ca3a4
commit
4511c76f49
@ -590,6 +590,11 @@ export class Tabs extends TabsBase {
|
||||
|
||||
this._ios.dataSource = this._dataSource;
|
||||
this._ios.delegate = this._delegate;
|
||||
|
||||
if (!this.tabBarItems) {
|
||||
const tabStripItems = this.tabStrip ? this.tabStrip.items : null;
|
||||
this.setTabStripItems(tabStripItems);
|
||||
}
|
||||
}
|
||||
|
||||
public onUnloaded() {
|
||||
@ -836,6 +841,10 @@ export class Tabs extends TabsBase {
|
||||
}
|
||||
|
||||
public setTabStripItems(items: Array<TabStripItem>) {
|
||||
if (!this.tabStrip || !items) {
|
||||
return;
|
||||
}
|
||||
|
||||
const tabBarItems = [];
|
||||
|
||||
items.forEach((item: TabStripItem, i) => {
|
||||
|
Reference in New Issue
Block a user