Slider doesn't draw (CodeName One) with Windows phone skin

喜你入骨 提交于 2019-12-11 16:47:02

问题


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?


回答1:


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.



来源:https://stackoverflow.com/questions/22145686/slider-doesnt-draw-codename-one-with-windows-phone-skin

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!