문제

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?

도움이 되었습니까?

해결책

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.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top