Proprietà che si comportano come le loro controparti CSS:
- height, maxHeight, minHeight (ad es. "100 px")
- width, maxWidth, minWidth (ad es. "100 px")
- padding, margin (ad es. "4px 4px 4px 4px" o semplicemente "4px")
- color, backgroundColor (ad es. "red" o "#FF0000")
- border (ad es. "1px solid black")
- borderColor (ad es. "red black blue #FF0000")
- borderRadius (ad es. "10 px")
- borderStyle (ad es. "solid dashed none dotted")
- borderWidth (ad es. "1px 0px 1px 0px")
- fontSize (ad es. "24 px")
- fontStyle (ad es. "italic")
- fontWeight (ad es. "bold" o "100")
- fontFamily (ad es. "monospace" o "serif")
- textAlign (ad es. "left" o "center")
- textDecoration (ad es. "underline" o "line-through")
- whiteSpace (ad es. "nowrap" o "pre")
- shown (true or false)
Proprietà del layout personalizzato supportate (consulta la documentazione di ui.Panel.Layout):
- stretch ("horizontal", "vertical", "both")
- position ("top-right", "top-center", "top-left", "bottom-right", ...)
Utilizzo | Resi |
---|---|
Textbox.style() | ui.data.ActiveDictionary |
Argomento | Tipo | Dettagli |
---|---|---|
questo: ui.widget | ui.Widget | L'istanza di ui.Widget. |
Esempi
Editor di codice (JavaScript)
// Define a UI widget and add it to the map. var widget = ui.Textbox({placeholder: 'Type here', style: {width: '400px'}}); Map.add(widget); // View the UI widget's style properties; an ActiveDictionary. print(widget.style()); // ActiveDictionaries are mutable; set a style property. widget.style().set('backgroundColor', 'lightgray'); print(widget.style()); // Define the UI widget's style ActiveDictionary as a variable. var widgetStyle = widget.style(); print(widgetStyle); // Set the UI widget's style properties from the ActiveDictionary variable. widgetStyle.set({border: '5px solid darkgray'}); print(widgetStyle);