欄位與圖示
透過集合功能整理內容
你可以依據偏好儲存及分類內容。
欄位和圖示都是顯示在方塊上的視覺元素,但用途不同。
欄位會顯示或定義有關積木的資料,進而影響程式的運作方式。舉例來說,文字方塊有兩個引號,表示您要定義字串,以及可定義該字串的文字輸入內容。引號會說明方塊的功能,輸入內容則可讓您修改函式。
圖示會顯示或定義區塊本身的「中繼」資訊。舉例來說,您可以在任何方塊中附加註解圖示,撰寫筆記供自己參考,但不會影響方塊在程式中的運作方式。
功能比較
屬性 |
欄位 |
圖示 |
轉譯 |
欄位可由任何元素組成。 |
圖示可由任何元素組成。 |
數字 |
每個欄位在區塊中可出現任意次數。 |
每個圖示在一個區塊中只能出現一次。 |
刊登位置 |
欄位可放置在區塊任何輸入內容的任何位置。 |
圖示一律位於區塊的頂端開頭。 |
序列化 |
欄位可以序列化,而且通常會序列化。 |
圖示可以序列化,但通常不會,因為圖示通常沒有狀態。 |
收合 |
區塊收合時,系統會隱藏欄位,並改為顯示欄位文字。 |
圖示可控制區塊收合時是否顯示。 |
除非另有註明,否則本頁面中的內容是採用創用 CC 姓名標示 4.0 授權,程式碼範例則為阿帕契 2.0 授權。詳情請參閱《Google Developers 網站政策》。Java 是 Oracle 和/或其關聯企業的註冊商標。
上次更新時間:2025-09-29 (世界標準時間)。
[[["容易理解","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-09-29 (世界標準時間)。"],[],["Fields and icons are distinct visual elements on a block with different purposes. Fields display or define data affecting a program's function, like the quotation marks and text input on a text block. Icons provide \"meta\" information about a block, such as a comment icon, which doesn't impact program function. Fields can appear multiple times, have varied rendering and placement, and are often serialized. Icons appear once per block, are fixed at the top-start, and are often not serialized, but can control visibility when a block is collapsed.\n"]]