We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Layout.init阶段核心仅仅是根据xml和css创建了节点树,Layout.init之后是执行 Layout.layout执行渲染
之所以将 layout 单独抽象为一个函数,是因为 layout 应当是可以重复调用的,比如改变了一个元素的尺寸,实际上节点树是没变的,仅仅是需要重新计算布局,然后渲染
一个完整的 layout 分成下面的几步:
其中步骤2 css-layout 并不会理解 display: none属性,要实现这个属性,应当是从节点树中临时剔除然后重新计算布局,同时要考虑 display: block 重置回去的场景。
The text was updated successfully, but these errors were encountered:
参照Yoga的实现是将布局属性全部置空 https://github.com/facebook/yoga/blob/main/yoga/Yoga.cpp#L1822
Layout里面,计算布局是直接作用于整个节点树,思路上可能是·动态设置display:none的时候将布局属性暂存 -> 重新计算布局 ->display: block -> 暂存属性重新使用->重新计算布局。
Sorry, something went wrong.
MisakiHCL
No branches or pull requests
Layout.init阶段核心仅仅是根据xml和css创建了节点树,Layout.init之后是执行 Layout.layout执行渲染
之所以将 layout 单独抽象为一个函数,是因为 layout 应当是可以重复调用的,比如改变了一个元素的尺寸,实际上节点树是没变的,仅仅是需要重新计算布局,然后渲染
一个完整的 layout 分成下面的几步:
其中步骤2 css-layout 并不会理解 display: none属性,要实现这个属性,应当是从节点树中临时剔除然后重新计算布局,同时要考虑 display: block 重置回去的场景。
The text was updated successfully, but these errors were encountered: