Apply a style to the accordion component
You can set style properties to change the border and background appearance of the accordion component.
The accordion component uses the following styles:
Style |
Topic |
Description |
themeColor |
Halo |
The basic color scheme of the component. This is the only color style that does not inherit the style value. Possible values include"haloGreen ","haloBlue "And"haloOrange ". |
backgroundColor |
Halo and Examples |
Background color. The default color is white. |
borderStyle |
Halo and Examples |
The accordion component uses the rectborder instance as its border and responds to the styles defined on this class. For more information, see rectborder class. The default border style value of the accordion component is"solid ". |
headerHeight |
Halo and Examples |
The height (in pixels) of the title button ). The default value is 22. |
color |
Halo and Examples |
Text color. The default value of the "Halo" topic is 0x0b333c, and the default value of the "example" topic is blank. |
disabledColor |
Halo and Examples |
The text color when the component is disabled. The default value is 0x848384 (dark gray ). |
embedFonts |
Halo and Examples |
A boolean value that indicatesfontFamily Whether the specified font is an embedded font. IffontFamily If the embedded font is referenced, the style must be settrue . Otherwise, the embedded font is not used. If this style is settrue AndfontFamily If no embedded font is referenced, no text is displayed. The default value isfalse . |
fontFamily |
Halo and Examples |
The font name of the title label. The default value is"_sans" . |
fontSize |
Halo and Examples |
The pound value of the title label font. The default value is 10. |
fontStyle |
Halo and Examples |
The font style of the title label;"normal" Or"italic" . The default value is"normal" . |
fontWeight |
Halo and Examples |
Font width of the title label;"none" Or"bold" . The default value is"none" . Before callingsetStyle() During this period, all components can accept the value"normal" To replace"none" But thengetStyle() Will return"none" . |
textDecoration |
Halo and Examples |
Text modifier;"none" Or"underline" . |
openDuration |
Halo and Examples |
Duration (in milliseconds) of the Transition animation ). |
openEasing |
Halo and Examples |
Reference of the animation population function. The default value is sine input/output. For more information, see custom component animation in "use components. |
For example, the following code is namedMy_accThe font style appearance in the accordion instance is set to italic:
my_acc.setStyle("fontStyle", "italic");