透過集合功能整理內容
你可以依據偏好儲存及分類內容。
封鎖 >IMetricsManager >getMetrics
IMetricsManager.getMetrics() 方法
傳回一個物件,其中包含頂層工作區捲軸的大小捲軸所需的所有指標。計算下列屬性:像素座標、-left、-up、+right、+down .viewHeight:工作區可見部分的高度。.viewWidth:工作區可見部分的寬度。.contentHeight:內容的高度。.contentWidth:內容的寬度。.svgHeight: Blockly div 的高度 (檢視畫面 + 工具箱,可以是簡單的或其他形式)、.svgWidth: Blockly div 的寬度 (檢視畫面 + 工具箱、簡單或其他屬性)、.viewTop:相對於工作區起點,工作區可見部分的頂端邊緣。.viewLeft:相對於工作區來源,工作區可見部分的左側邊緣。.contentTop:內容的頂端邊緣,相對於工作區來源。.contentLeft:相對於工作區來源的內容左側邊緣。.absoluteTop:與 blocklyDiv 相比,工作區可見部分的頂端邊緣。.absoluteLeft:以 BlocklyDiv 相對來說,工作區可見部分的左側邊緣。.toolboxWidth:工具箱的寬度 (如果有的話)。否則為 0。.toolboxHeight:工具箱的高度 (如有)。否則為 0。.flyoutWidth:如果是一律打開的飛艙寬度。否則為 0。.flyoutHeight:如果飛艙永遠處於開放狀態,其高度。否則為 0。.toolboxPosition:頂端、底部、左側或右側。使用 TOOLBOX_AT 常數進行比較。
Signature:
getMetrics(): Metrics;
傳回:
指標
包含頂層工作區的大小和位置指標。
除非另有註明,否則本頁面中的內容是採用創用 CC 姓名標示 4.0 授權,程式碼範例則為阿帕契 2.0 授權。詳情請參閱《Google Developers 網站政策》。Java 是 Oracle 和/或其關聯企業的註冊商標。
上次更新時間: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"]],["上次更新時間:2025-07-25 (世界標準時間)。"],[],["The `getMetrics()` method, part of the `IMetricsManager` interface, returns a `Metrics` object detailing the size and position of a top-level Blockly workspace. This includes properties such as `viewHeight`, `viewWidth`, `contentHeight`, `contentWidth`, `svgHeight`, and `svgWidth`. It also includes `viewTop`, `viewLeft`, `contentTop`, `contentLeft`, `absoluteTop`, `absoluteLeft`. It calculates the size and location of the toolbox (`toolboxWidth`, `toolboxHeight`) and the flyout (`flyoutWidth`, `flyoutHeight`), and returns the `toolboxPosition` as top, bottom, left or right.\n"]]