我是黑莓开发的新手,并且关于Spinboxfield和非触摸设备的代码部分。我将感谢任何帮助,代码示例回复或指向相关教程的链接,其中显示了如何在非触摸设备上使用spinboxfield(例如黑莓曲线或粗体3)。当屏幕包含旋转磁场和另一个控件例如按钮时,会出现问题。一旦用户进入spinboxfieldmanager区域,从spinboxfield滚动到按钮是非常不可能的,他们无法导航到按钮控件并且用户卡在spinboxfield控件中。我尝试过代码“SpinBoxFieldManager.setClickToLock(false)”,但这不起作用。示例代码如下所示
// an array of choices for the months.
final String[] MONTHS = { "January", "February", "March", "April", "May", "June",
"July", "August", "September", "October", "November", "December"};
// an array of choices for years
final String[] YEARS = { "2001", "2002", "2003", "2004", "2005", "2006", "2007",
"2008", "2009", "2010", "2011", "2012", "2013", "2014"};
// use a text spin box to display these choices
SpinBoxField monthSpinBox = new TextSpinBoxField(MONTHS);
SpinBoxField _yearsSpinBox = new TextSpinBoxField(YEARS);
// create a manager for these spin boxes
SpinBoxFieldManager spinBoxManager = new SpinBoxFieldManager();
// add the spin boxes
spinBoxManager.add(monthSpinBox);
spinBoxManager.add(yearsSpinBox);
spinBoxManager.setClickToLock(false);
this.add(spinBoxManager);
ButtonField mybutton = new ButtonField("MY Button", ButtonField.CONSUME_CLICK);
mybutton.setChangeListener(this);
this.add(mybutton);
除触摸设备外,显然无法使用键盘从旋转框字段滚动到按钮。
提前致谢。
答案 0 :(得分:0)
http://docs.blackberry.com/en/developers/deliverables/24222/Spin_boxes_887725_11.jsp
最佳实践:
...
我会使用弹出屏幕显示旋转框,如页面上的图像所示。