ui.Textbox.style

Widget'ın stillerini güncellemek için değiştirilebilen ActiveDictionary adlı widget stilini döndürür.

CSS karşılıkları gibi davranan özellikler:

  - height, maxHeight, minHeight (ör. "100px")

  - width, maxWidth, minWidth (ör. "100px")

  - dolgu, kenar boşluğu (ör. "4 piksel 4 piksel 4 piksel 4 piksel" veya yalnızca "4 piksel")

  - color, backgroundColor (ör. "red" veya "#FF0000")

  - border (ör. "1px solid black")

  - borderColor (ör. "red black blue #FF0000")

  - borderRadius (ör. "10px")

  - borderStyle (ör. "solid dashed none dotted")

  - borderWidth (ör. "1px 0px 1px 0px")

  - fontSize (ör. "24px")

  - fontStyle (ör. "italic")

  - fontWeight (ör. "bold" veya "100")

  - fontFamily (ör. "monospace" veya "serif")

  - textAlign (ör. "left" veya "center")

  - textDecoration (ör. "underline" veya "line-through")

  - whiteSpace (ör. "nowrap" veya "pre")

  - gösterildi (doğru veya yanlış)

Desteklenen özel düzen özellikleri (bkz. ui.Panel.Layout dokümanları):

  - stretch ('horizontal', 'vertical', 'both')

  - position ('top-right', 'top-center', 'top-left', 'bottom-right', ...)

Kullanımİadeler
Textbox.style()ui.data.ActiveDictionary
Bağımsız DeğişkenTürAyrıntılar
bu: ui.widgetui.Widgetui.Widget örneği.

Örnekler

Kod Düzenleyici (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);