Search code examples
codenameone

Change layout of Infinite Container


I am adding elements to my infinite container and they add vertically by default. But, I would like to change the infinite container from adding elements vertically and it adds horizontally. How do I do that?


Solution

  • You can use:

    ic.setLayout(BoxLayout.x());
    ic.setScrollableY(false);
    ic.setScrollableX(true);
    

    This lays the container horizontally. I'm not sure if this was tested but it should work.