แบบสำรวจการวิจัย: บอกให้เราทราบเกี่ยวกับประสบการณ์การใช้งาน Blockly
เริ่มแบบสำรวจ
blockly > ตาราง > setSpacing
เมธอด Grid.setSpacing()
ตั้งค่าระยะห่างระหว่างกึ่งกลางของเส้นตารางกริด
การดำเนินการนี้จะไม่ทริกเกอร์การสแนปกับตารางกริดที่เว้นระยะห่างใหม่ หากต้องการสแนปบล็อกไปยังตารางกริดแบบเป็นโปรแกรมซึ่งจำเป็นต้องทริกเกอร์ในการบล็อกระดับบนสุดแต่ละรายการ ครั้งต่อไปที่ลากและวางบล็อก ระบบจะสแนปกับตารางกริดหากเปิดใช้การสแนปกับตารางกริดไว้
ลายเซ็น:
setSpacing(spacing: number): void;
พารามิเตอร์
พารามิเตอร์ |
ประเภท |
คำอธิบาย |
ระยะห่าง |
ตัวเลข |
|
การคืนสินค้า:
เป็นโมฆะ
เนื้อหาของหน้าเว็บนี้ได้รับอนุญาตภายใต้ใบอนุญาตที่ต้องระบุที่มาของครีเอทีฟคอมมอนส์ 4.0 และตัวอย่างโค้ดได้รับอนุญาตภายใต้ใบอนุญาต Apache 2.0 เว้นแต่จะระบุไว้เป็นอย่างอื่น โปรดดูรายละเอียดที่นโยบายเว็บไซต์ Google Developers Java เป็นเครื่องหมายการค้าจดทะเบียนของ Oracle และ/หรือบริษัทในเครือ
อัปเดตล่าสุด 2024-08-21 UTC
[null,null,["อัปเดตล่าสุด 2024-08-21 UTC"],[[["Sets the spacing between grid lines, without automatically snapping existing blocks."],["To snap blocks after changing spacing, it needs to be triggered individually or during the next drag-and-drop."],["The `setSpacing()` method takes one argument: `spacing`, a number representing the desired space between grid lines."]]],["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"]]