mirror of
https://github.com/NativeScript/NativeScript.git
synced 2025-11-05 13:26:48 +08:00
5620 GridLayout addChild to set row and column (#6411)
This commit is contained in:
committed by
Alexander Vakrilov
parent
4407af7dd6
commit
a3f149325f
@@ -178,6 +178,18 @@ export class GridLayoutBase extends LayoutBase implements GridLayoutDefinition {
|
||||
this.invalidate();
|
||||
}
|
||||
|
||||
public addChildAtCell(view: View, row: number, column: number, rowSpan?: number, columnSpan?: number): void {
|
||||
this.addChild(view);
|
||||
GridLayoutBase.setRow(view, row);
|
||||
GridLayoutBase.setColumn(view, column);
|
||||
if (rowSpan) {
|
||||
GridLayoutBase.setRowSpan(view, rowSpan);
|
||||
}
|
||||
if (columnSpan) {
|
||||
GridLayoutBase.setColumnSpan(view, columnSpan);
|
||||
}
|
||||
}
|
||||
|
||||
public removeRow(itemSpec: ItemSpec): void {
|
||||
if (!itemSpec) {
|
||||
throw new Error("Value is null.");
|
||||
|
||||
@@ -101,6 +101,11 @@ export class GridLayout extends LayoutBase {
|
||||
*/
|
||||
public addRow(itemSpec: ItemSpec): void;
|
||||
|
||||
/**
|
||||
* Adds a child at specific cell in GridLayout. Optional rowSpan and columnSpan attributes
|
||||
*/
|
||||
public addChildAtCell(view: View, row: number, column: number, rowSpan?: number, columnSpan?: number): void;
|
||||
|
||||
/**
|
||||
* Removes a column specification from a GridLayout.
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user