Codename One Picker文本在选择项目后旋转

时间:2018-04-05 19:35:21

标签: codenameone picker

我有一个CN1应用程序,在容器内使用三个拾取器。

其中一个选择器只包含小字符串,如“1x”,“2x”等。

每次在正在运行的应用程序上选择一个项目时,所选文本的旋转速度非常快,看起来有些奇怪。

我尝试将填充和边距设置为零,并将SmoothScrolling设置为false。

picker.setSmoothScrolling(false); 

一切都无济于事。

有解决方案吗?非常感谢提前..

以下是代码的相关部分:

    private final Picker pickerInterval = new Picker();   
    private final Picker pickerDayOrMonth = new Picker(); 
    private final Picker pickerFinal = new Picker();     

    String stringPickerInterval = "repetir a cada ..";
    pickerInterval.setType(Display.PICKER_TYPE_STRINGS);
    pickerInterval.setUIID("DatePickerDialog");
    pickerInterval.setStrings("1","2","3","4","5","6","6","8","9","10","11","12",stringPickerInterval);        
    pickerInterval.setSelectedString(stringPickerInterval);
    pickerInterval.addActionListener((e) -> {
        if (!pickerInterval.getSelectedString().equals(stringPickerInterval)) {
            pickerInterval.setUIID("DatePickerDialogSelected"); 
        } else {
            pickerInterval.setUIID("DatePickerDialog"); 
        }
    });

    String stringPickerDayOr = "dias ou semanas ou ...";
    pickerDayOrMonth.setType(Display.PICKER_TYPE_STRINGS);
    pickerDayOrMonth.setUIID("DatePickerDialog");
    pickerDayOrMonth.setStrings("Dia(s)", "Semana(s)", "Mes(es)","Ano(s)" , stringPickerDayOr);       
    pickerDayOrMonth.setSelectedString(stringPickerDayOr);
    pickerDayOrMonth.addActionListener((e) -> {
        if (!pickerDayOrMonth.getSelectedString().equals(stringPickerDayOr)) {
            pickerDayOrMonth.setUIID("DatePickerDialogSelected"); 
        } else {
            pickerDayOrMonth.setUIID("DatePickerDialog"); 
        }
    });        

    String stringPickerFinal = "freqüência das repetições ..";
    pickerFinal.setType(Display.PICKER_TYPE_STRINGS);
    pickerFinal.setUIID("DatePickerDialog");
    pickerFinal.setStrings("1 x","2 x","3 x","4 x","5 x","6 x","6 x","8 x","9 x","10 x","11 x","12 x" , stringPickerFinal);        
    pickerFinal.setSelectedString(stringPickerFinal);   
    pickerFinal.addActionListener((e) -> {
        if (!pickerFinal.getSelectedString().equals(stringPickerFinal)) {
            pickerFinal.setUIID("DatePickerDialogSelected"); 
        } else {
            pickerFinal.setUIID("DatePickerDialog"); 
        }
    });

    container = new Container(new GridLayout(1, 3));
    container.setUIID("ContainerPicker");
    container.add(pickerInterval).add(pickerDayOrMonth).add(pickerFinal);    

0 个答案:

没有答案