iOS:add FlexLayoutNode

This commit is contained in:
pengfei.zhou
2020-04-09 20:01:22 +08:00
committed by osborn
parent 404b4b594f
commit 6f09341723
16 changed files with 697 additions and 69 deletions

View File

@@ -25,4 +25,7 @@ export declare class HLayout extends LinearLayout implements IHLayout {
export declare function stack(views: View[], config?: IStack): Stack;
export declare function hlayout(views: View[], config?: IHLayout): HLayout;
export declare function vlayout(views: View[], config?: IVLayout): VLayout;
export declare class FlexLayout extends Group {
}
export declare function flexlayout(views: View[], config: IView): FlexLayout;
export {};

View File

@@ -82,3 +82,17 @@ export function vlayout(views, config) {
}
return ret;
}
export class FlexLayout extends Group {
}
export function flexlayout(views, config) {
const ret = new FlexLayout;
for (let v of views) {
ret.addChild(v);
}
if (config) {
for (let key in config) {
Reflect.set(ret, key, Reflect.get(config, key, config), ret);
}
}
return ret;
}