mirror of
https://github.com/NativeScript/NativeScript.git
synced 2025-08-17 04:41:36 +08:00
adding removeChildren() for layout and fixing comment typos
This commit is contained in:

committed by
Vladimir Enchev

parent
8bc2aedfae
commit
e79fd51ce4
5
ui/layouts/layout-base.d.ts
vendored
5
ui/layouts/layout-base.d.ts
vendored
@ -45,6 +45,11 @@
|
||||
*/
|
||||
removeChild(view: view.View);
|
||||
|
||||
/**
|
||||
* Removes all views in this layout.
|
||||
*/
|
||||
removeChildren();
|
||||
|
||||
/**
|
||||
* Gets or sets padding style property.
|
||||
*/
|
||||
|
@ -56,6 +56,12 @@ export class LayoutBase extends view.CustomLayoutView implements definition.Layo
|
||||
this._subViews.splice(index, 1);
|
||||
}
|
||||
|
||||
public removeChildren() {
|
||||
while (this.getChildrenCount() != 0) {
|
||||
this.removeChild(this._subViews[this.getChildrenCount() - 1]);
|
||||
}
|
||||
}
|
||||
|
||||
public _eachChildView(callback: (child: view.View) => boolean) {
|
||||
var i;
|
||||
var length = this._subViews.length;
|
||||
|
Reference in New Issue
Block a user