2011-01-20 48 views

回答

-1

覆蓋NavigationClick,下面是例子

public boolean navigationClick(int status,int time){ 
    Field focus = _countries.getLeafFieldWithFocus(); 
    if(focus instanceof ListField){ 
     ListField listField = (ListField)focus; 
     country = listField.getCallback().get(listField,listField.getSelectedIndex()).toString();//this will return the text clicked from the listfield 

    TransitionContext transition = new TransitionContext(TransitionContext.TRANSITION_FADE); 
    transition.setIntAttribute(TransitionContext.ATTR_DURATION,500); 
    transition.setIntAttribute(TransitionContext.ATTR_DIRECTION,TransitionContext.DIRECTION_DOWN); 
    transition.setIntAttribute(TransitionContext.ATTR_STYLE,TransitionContext.STYLE_PUSH); 

    UiEngineInstance engine = Ui.getUiEngineInstance(); 
    engine.setTransition(MyApp.scr,MyScreen._radio,UiEngineInstance.TRIGGER_PUSH,transition); 
    MyApp.scr=null; 
    UiApplication.getUiApplication().popScreen(UiApplication.getUiApplication().getActiveScreen()); 
    UiApplication.getUiApplication().pushScreen(MyScreen._radio); 
    } 

    return true;  
} 
+0

這是推動ListField項目點擊的另一個屏幕的唯一方法,這裏沒有人有魔杖..... – 2011-12-10 04:46:59

相關問題