LayoutService
种类:class
提供对 Yoga 布局功能的访问。
属性
IsInBatch
readonly bool IsInBatch
确定 UIManager 当前是否正在处理一批节点更新。这对于优化布局和确保将布局应用于特定节点不会在渲染的 UI 中造成撕裂非常有用。
方法
ApplyLayout
void ApplyLayout(int64_t reactTag, float width, float height)
从给定的 React 节点递归应用具有提供的大小约束的布局。此方法将在给定节点及其后代上触发 Yoga 布局操作,并将布局结果应用于这些节点。
ApplyLayoutForAllNodes
void ApplyLayoutForAllNodes()
递归地将布局应用于所有根节点。此方法将在附加到 React 实例的根节点上触发 Yoga 布局操作,并将布局结果应用于所有后代节点。
FromContext
static LayoutService FromContext(IReactContext context)
使用此方法访问与 IReactContext 相关联的 LayoutService。
MarkDirty
void MarkDirty(int64_t reactTag)
将特定的 React 节点标记为 Yoga 布局的脏节点。