調査アンケート: Blockly のご利用体験についてお聞かせください
アンケートを開始
コレクションでコンテンツを整理
必要に応じて、コンテンツの保存と分類を行います。
ブロックする >フィールド >applyColour
Field.applyColour() メソッド
ブロックの色やスタイルに合わせてフィールドを更新します。
フィールドの色がブロックの色に依存する場合、非抽象サブクラスでこれを実装するとよいでしょう。これは、親ブロックやレンダラが変更されたときなど、関連するタイミングで自動的に呼び出されます。
詳細については、フィールドのドキュメントをご覧ください。例については、FieldDropdown をご覧ください。
署名:
applyColour(): void;
戻り値:
void
特に記載のない限り、このページのコンテンツはクリエイティブ・コモンズの表示 4.0 ライセンスにより使用許諾されます。コードサンプルは Apache 2.0 ライセンスにより使用許諾されます。詳しくは、Google Developers サイトのポリシーをご覧ください。Java は Oracle および関連会社の登録商標です。
最終更新日 2025-07-25 UTC。
[[["わかりやすい","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 UTC。"],[[["The `applyColour()` method updates a field's color to match its parent block."],["Subclasses of `Field` can implement this method to customize how their color is affected by the block's color."],["It's automatically called when the block or renderer's color changes, ensuring the field's color remains consistent."],["Refer to the field documentation or the `FieldDropdown` class for implementation examples."]]],["The `Field.applyColour()` method updates a field to match the color or style of its parent block. Subclasses can implement this method if the field's appearance depends on the block's color. This method is automatically called when the parent block or renderer changes. It takes no arguments and returns nothing (`void`). Detailed information can be found in the field documentation, with `FieldDropdown` as a practical example.\n"]]