Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/blackberry/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Blackberry 如何允许在不同的管理器字段之间滚动方向?_Blackberry_Field - Fatal编程技术网

Blackberry 如何允许在不同的管理器字段之间滚动方向?

Blackberry 如何允许在不同的管理器字段之间滚动方向?,blackberry,field,Blackberry,Field,让我举个例子。此代码在管理器中工作: 受保护的布尔导航移动(int-dx、int-dy、int-status、int-time){ int focusIndex=getFieldWithFocusIndex(); 而(dy>0){ 如果(focusIndex+columnwidth.length>=getFieldCount()){ 返回false; }否则{ 字段f=getField(focusIndex+columnwidth.length); if(f.isFocusable()){ f、

让我举个例子。此代码在管理器中工作:

受保护的布尔导航移动(int-dx、int-dy、int-status、int-time){
int focusIndex=getFieldWithFocusIndex();
而(dy>0){
如果(focusIndex+columnwidth.length>=getFieldCount()){
返回false;
}否则{
字段f=getField(focusIndex+columnwidth.length);
if(f.isFocusable()){
f、 setFocus();
dy--;
}
}
}
而(dy<0){
if(聚焦索引-columnwidth.length<0){
返回false;
}否则{
字段f=getField(focusIndex-columnwidth.length);
if(f.isFocusable()){
f、 setFocus();
dy++;
}
}
}
而(dx>0){
focusIndex++;
如果(focusIndex>=getFieldCount()){
返回false;
}否则{
字段f=获取字段(焦点索引);
if(f.isFocusable()){
f、 setFocus();
dx--;
}
}
}
而(dx<0){
聚焦指数--;
如果(聚焦指数<0){
返回false;
}否则{
字段f=获取字段(焦点索引);
if(f.isFocusable()){
f、 setFocus();
dx++;
}
}
}
返回true;
}
现在,我的屏幕添加了3个不同的经理,如下所示

add(新的自定义字段(this,0,-1,”,1,1));
添加(新自定义_底部字段(this,0));
添加(新的自定义标题字段(Config_GlobalFunction.latest));

all也
扩展管理器
,但当我向下时,它会向左移动,而不是向下移动。

我找到了一个解决方案,但这个解决方案根本不实用。我在一个java类中创建了所有类。因此,该类不能重用。

行的字段总数->4您将上面显示的
navigationMovement()
方法放在哪里了?你把它放在所有三个类中了吗:
Custom\u TopField
Custom\u BottomField
,和
Custom\u HeaderField
?不,有三个不同的类。我试图让它只在类内工作,但不能跨类工作。例如,第一类,我有3个水平字段。当我向左向右移动时,它是合乎逻辑的,但当我向上向下移动时,它仍然会按逻辑向左和向右移动,它应该离开这个类,关注另一个类,即第四个字段