UML类图

立即使用

leopard::bone::ViewLayoutBaseDelegate

+ GetViewID():std::string

+ IsVisible():bool

+ SizeThatFits(gfx::Size):gfx::Size

+ UpdateLayout():void

+ OnUpdateFrame(gfx::Rect):void

BindingView

+ view_: ui::View*

+ layout_obj_: std::shared_ptr<leopard::bone::LayoutObject>

+ AddChild(params) : void

...

ui::View

leopard::bone::LayoutObject

+ frame_: gfx::Rect

- view_: std::weak_ptr<ViewLayoutBaseDelegate>

- yoga_: std::unique_ptr<YogaLayout>

- parent_: std::shared_ptr<LayoutObject>

- children_: std::vector<std::shared_ptr<LayoutObject>>

+ MarkDirty() : void


//将解析完成的CSS或者style属性设置到LayoutObject

//然后根据依赖的布局库计算出UI控件的frame位置

+ SetFlexXXXX(): void

1..1

1..1

1..1

leopard::bone::LayoutTree

+ root_: std::shared_ptr<LayoutObject>

// 具体生成布局树的方式需要跟方博确认

+ parseNode(): std::shared_ptr<LayoutObject>


//根据BindingView的父子关系,生成布局树

//执行layout布局即可

+ layout() : void

n..1

YogaLayout

第三方布局库

1..n

138
0
1
发布时间: 2021-11-15