本页内容

变体图层已移动

在某个变体中,默认变体将某个图层移动到了其同级图层中的其他位置,或移到了不同的父图层之下。由于 QML 状态无法移动图层,因此插件会保留默认变体所放置的图层位置,并忽略其他变体对其所做的更改。该图层在每个状态下仍会被渲染。

若要保留变体中的更改,请在每个变体中为该图层设置相同的父图层和相同的位置。

如何在 Figma 中避免此错误

设计一组变体,确保每个变体中的同一图层始终保持一致。插件通过图层名称及其在 Figma “Layers ” 面板中的位置来识别图层。有关更多信息,请参阅《设计组件变体》。

以下示例未遵循此准则,因此插件会显示相关问题。

在“Card ”组件的“Hover ”变体中,有三个图层的顺序与默认变体不同。

变体层已移动。

在Card 组件中,Simple 变体包含Default 变体中也存在的图层,但由于Simple 变体的图层数量少于Default 变体,因此这些图层的位置有所不同。

变体层已移动。

另请参阅 “修复转换问题”和“变体”。

© 2026 The Qt Company Ltd. Documentation contributions included herein are the copyrights of their respective owners. The documentation provided herein is licensed under the terms of the GNU Free Documentation License version 1.3 as published by the Free Software Foundation. Qt and respective logos are trademarks of The Qt Company Ltd in Finland and/or other countries worldwide. All other trademarks are property of their respective owners.