Mit Sammlungen den Überblick behalten
Sie können Inhalte basierend auf Ihren Einstellungen speichern und kategorisieren.
blockly > Feld > applyColour
Methode "Field.applyColour()"
Aktualisiert das Feld an die Farbe/den Stil des Blocks
Diese Implementierung kann für nicht abstrakte Unterklassen sinnvoll sein, wenn die Farbe des Felds von der Farbe des Blocks abhängt. Es wird automatisch zu relevanten Zeitpunkten aufgerufen, etwa wenn sich der übergeordnete Block oder der Renderer ändert.
Weitere Informationen finden Sie in der Felddokumentation oder als Beispiel „FieldDropdown“.
Unterschrift:
applyColour(): void;
Gibt zurück:
voidm
Sofern nicht anders angegeben, sind die Inhalte dieser Seite unter der Creative Commons Attribution 4.0 License und Codebeispiele unter der Apache 2.0 License lizenziert. Weitere Informationen finden Sie in den Websiterichtlinien von Google Developers. Java ist eine eingetragene Marke von Oracle und/oder seinen Partnern.
Zuletzt aktualisiert: 2024-09-12 (UTC).
[[["Leicht verständlich","easyToUnderstand","thumb-up"],["Mein Problem wurde gelöst","solvedMyProblem","thumb-up"],["Sonstiges","otherUp","thumb-up"]],[["Benötigte Informationen nicht gefunden","missingTheInformationINeed","thumb-down"],["Zu umständlich/zu viele Schritte","tooComplicatedTooManySteps","thumb-down"],["Nicht mehr aktuell","outOfDate","thumb-down"],["Problem mit der Übersetzung","translationIssue","thumb-down"],["Problem mit Beispielen/Code","samplesCodeIssue","thumb-down"],["Sonstiges","otherDown","thumb-down"]],["Zuletzt aktualisiert: 2024-09-12 (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"]]