使用集合让一切井井有条
根据您的偏好保存内容并对其进行分类。
blockly >网格 >setSpacing
Grid.setSpacing() 方法
设置网格线中心之间的间距。
这不会触发贴靠到新间隔的网格。如果您想以编程方式将块贴靠到网格,则需要在各个顶级块上触发。如果启用了对齐网格功能,则下次您拖放某个块时,它将贴靠网格。
Signature:
setSpacing(spacing: number): void;
参数
返回:
void
如未另行说明,那么本页面中的内容已根据知识共享署名 4.0 许可获得了许可,并且代码示例已根据 Apache 2.0 许可获得了许可。有关详情,请参阅 Google 开发者网站政策。Java 是 Oracle 和/或其关联公司的注册商标。
最后更新时间 (UTC):2025-07-25。
[[["易于理解","easyToUnderstand","thumb-up"],["解决了我的问题","solvedMyProblem","thumb-up"],["其他","otherUp","thumb-up"]],[["没有我需要的信息","missingTheInformationINeed","thumb-down"],["太复杂/步骤太多","tooComplicatedTooManySteps","thumb-down"],["内容需要更新","outOfDate","thumb-down"],["翻译问题","translationIssue","thumb-down"],["示例/代码问题","samplesCodeIssue","thumb-down"],["其他","otherDown","thumb-down"]],["最后更新时间 (UTC):2025-07-25。"],[],["The `Grid.setSpacing()` method adjusts the distance between grid line centers. It accepts a numerical `spacing` parameter. This action doesn't automatically snap existing blocks to the new grid; individual top-level blocks must trigger snapping separately. However, blocks dragged and dropped afterward will snap if grid snapping is active. The method returns nothing (void).\n"]]