1
This is because you are putting the text as caption (.caption
), try with the code below.
public class AccordionSample extends MainWindow{
public AccordionSample(){
setUIStyle(Settings.MATERIAL_UI);
}
public void initUI(){
AccordionContainer.Group gr = new AccordionContainer.Group();
AccordionContainer ac[] = new AccordionContainer[5];
Label lb = new Label("Lorem ipsum dolor sit amet, consectetur \nadipiscing elit. Vivamus pellentesque massa \nnon magna maximus fermentum."
+ " \nNunc condimentum tempor odio, in dictum \nneque sollicitudin sit amet. Sed ut venenatis \nsem."
+ " \nMorbi sagittis purus fringilla, suscipit lorem \nquis, cursus ipsum. Donec sodales rutrum \nrisus, ac sagittis est laoreet ac. "
+ "\nCurabitur egestas leo.");
ac[0] = new AccordionContainer(gr);
ac[0].setFont(font.asBold());
add(ac[0],LEFT+10,CENTER,PARENTSIZE+95,PARENTSIZE+43);
ac[0].setBackForeColors(0X757575, 0Xffffff);
ac[0].add(ac[0].new Caption("Any Text:"), LEFT+5, TOP, FILL, PREFERRED);
ac[0].add(lb,LEFT+5,TOP+22,FILL,PREFERRED);
}
}