js: add navbar set center api
This commit is contained in:
@@ -2879,7 +2879,8 @@ class List extends Superview {
|
||||
}
|
||||
}
|
||||
scrollToItem(context, index, config) {
|
||||
const animated = config === null || config === void 0 ? void 0 : config.animated;
|
||||
var _a;
|
||||
const animated = (_a = config) === null || _a === void 0 ? void 0 : _a.animated;
|
||||
return this.nativeChannel(context, 'scrollToItem')({ index, animated, });
|
||||
}
|
||||
reset() {
|
||||
@@ -3628,7 +3629,14 @@ function navbar(context) {
|
||||
panel.addHeadView("navbar_right", view);
|
||||
}
|
||||
return context.callNative('navbar', 'setRight', view.toModel());
|
||||
}
|
||||
},
|
||||
setCenter: (view) => {
|
||||
if (panel) {
|
||||
panel.clearHeadViews("navbar_center");
|
||||
panel.addHeadView("navbar_center", view);
|
||||
}
|
||||
return context.callNative('navbar', 'setCenter', view.toModel());
|
||||
},
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user