Mantieni tutto organizzato con le raccolte
Salva e classifica i contenuti in base alle tue preferenze.
blockly > BlockSvg > setStyle
Metodo BlockSvg.setStyle()
Imposta i valori di stile e colore di un blocco.
Firma:
setStyle(blockStyleName: string): void;
Parametri
Parametro |
Tipo |
Descrizione |
blockStyleName |
stringa |
Nome dello stile del blocco. |
Resi:
null
Eccezioni
{Error} se lo stile del blocco non esiste.
Salvo quando diversamente specificato, i contenuti di questa pagina sono concessi in base alla licenza Creative Commons Attribution 4.0, mentre gli esempi di codice sono concessi in base alla licenza Apache 2.0. Per ulteriori dettagli, consulta le norme del sito di Google Developers. Java è un marchio registrato di Oracle e/o delle sue consociate.
Ultimo aggiornamento 2024-09-12 UTC.
[[["Facile da capire","easyToUnderstand","thumb-up"],["Il problema è stato risolto","solvedMyProblem","thumb-up"],["Altra","otherUp","thumb-up"]],[["Mancano le informazioni di cui ho bisogno","missingTheInformationINeed","thumb-down"],["Troppo complicato/troppi passaggi","tooComplicatedTooManySteps","thumb-down"],["Obsoleti","outOfDate","thumb-down"],["Problema di traduzione","translationIssue","thumb-down"],["Problema relativo a esempi/codice","samplesCodeIssue","thumb-down"],["Altra","otherDown","thumb-down"]],["Ultimo aggiornamento 2024-09-12 UTC."],[[["The `setStyle` method allows you to apply a predefined style and color scheme to a block element."],["This method requires a single argument, `blockStyleName`, which is a string representing the name of the desired style."],["If the specified `blockStyleName` doesn't exist within the system, the method will throw an error."],["Calling `setStyle` will not return any specific value, indicating its primary function is to modify the visual appearance of the block directly."]]],["The `BlockSvg.setStyle()` method sets a block's style and color values. It accepts a single parameter, `blockStyleName` (a string), which specifies the desired block style. The method returns `void`. It will throw an `Error` if the provided `blockStyleName` does not correspond to an existing block style. The method modifies the block's appearance based on the given style name.\n"]]