Question

I am trying to create a slider in codename one, but for some reason the slider isn't drawn, other components however, are. The code I have so far

public void start()
{

    if (current != null)
    {
        current.show();
        return;
    }

    mainForm = new Form("Slider and buttons");
    c = mainForm.getContentPane();
    c.setLayout(new FlowLayout());

    Slider jSlider = new Slider();
    jSlider.setMaxValue(360);
    jSlider.setMinValue(0);
    jSlider.setProgress(50);
    jSlider.setEditable(true);
    jSlider.setPreferredSize(new Dimension(300,50));

    c.addComponent(jSlider);
    c.repaint();
    c.invalidate();
    c.revalidate();


    mainForm.show();
}

I'm not sure what I could have forgotten, probably just overlooking something..

Thanks in advance

EDIT: It actually does draw the slider if I choose the iPhone skin, but it doesn't do so under "lumia", anyone know why that is?

Was it helpful?

Solution

Its just missing styles under the default Windows Phone theme. Just define the style SliderFull & Slider for both selected/unselected states. We fixed this for the next update.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top