CSS 속성과 동작하는 속성:
- height, maxHeight, minHeight (예: '100px')
- width, maxWidth, minWidth (예: '100px')
- padding, margin (예: '4px 4px 4px 4px' 또는 '4px')
- color, backgroundColor (예: 'red' 또는 '#FF0000')
- 테두리 (예: '1px solid black')
- borderColor (예: 'red black blue #FF0000')
- borderRadius (예: '10px')
- borderStyle (예: 'solid dashed none dotted')
- borderWidth (예: '1px 0px 1px 0px')
- fontSize (예: '24px')
- fontStyle (예: 'italic')
- fontWeight (예: 'bold' 또는 '100')
- fontFamily (예: 'monospace' 또는 'serif')
- textAlign (예: 'left' 또는 'center')
- textDecoration (예: 'underline' 또는 'line-through')
- whiteSpace (예: 'nowrap' 또는 'pre')
- 표시됨 (true 또는 false)
지원되는 맞춤 레이아웃 속성 (ui.Panel.Layout 문서 참고):
- stretch ('horizontal', 'vertical', 'both')
- 위치 ('top-right', 'top-center', 'top-left', 'bottom-right', ...)
사용 | 반환 값 |
---|---|
Checkbox.style() | ui.data.ActiveDictionary |
인수 | 유형 | 세부정보 |
---|---|---|
this: ui.widget | ui.Widget | ui.Widget 인스턴스 |
예
코드 편집기 (JavaScript)
// Define a UI widget and add it to the map. var widget = ui.Checkbox({label: 'A ui.Checkbox', 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('color', 'blue'); 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);