我正在黑莓曲線上工作8300trackroll不工作,因爲我想或期望做,黑莓
我已經在主屏幕添加了一些組件,現在我要當軌跡球向上移動垂直移動焦點或向下移動,並在軌道輪向左或向右移動時水平移動焦點。
============================================== ====================================
--Title area that contains a focusable field(BACK)--
--Non focusable Label field that indicates the name of the user--
--A horizontal field manager1 that contains 4 buttons--
--A horizontal field manager2 that contains 4 buttons--
--A horizontal field manager2 that contains 4 buttons--
======= ================================================== =========================
現在假設當前焦點在BACK按鈕上,然後向下滾動軌道輪, 焦點應該出現在manager1的第一個按鈕上 再次向下滾動時,焦點應該出現在manager2的第一個按鈕上,而不是manager1的第二個按鈕(因爲它在設備上發生)
我的代碼是:::
protected boolean trackwheelRoll(int amount, int status, int time)
{
focusIndex = this.getFieldWithFocusIndex();
System.out.println("focus index ::::::::::::::::"+focusIndex);
Field f;
if(focusIndex!=0)
{
if(amount==-1)
{
//move up
if(focusIndex>=0)
{
focusIndex = focusIndex-1;
f = getField(focusIndex);
f.setFocus();
}
}
if(amount==1)
{
//moving down
if(focusIndex<=3)
{
f = getField(++focusIndex);
f.setFocus();
}
}
}
return super.trackwheelRoll(amount, status, time);
}
即使突然在模擬器 但對設備沒有變化發生
你的想法工作! 我試過導航運動 我意識到撥輪不適用於有空間墊或軌跡球的設備 – Swati 2010-05-01 06:17:38