0
我想顯示另一個屏幕,當用戶點擊一個ListField。除了pushscreen以外,還有其他方法可以轉到下一個屏幕嗎?
但是我的包含ListField的類擴展了MainScreen!
如何推到另一個屏幕?
除了pushScreen之外,還有其他方法可以轉到另一個屏幕嗎?
我想顯示另一個屏幕,當用戶點擊一個ListField。除了pushscreen以外,還有其他方法可以轉到下一個屏幕嗎?
但是我的包含ListField的類擴展了MainScreen!
如何推到另一個屏幕?
除了pushScreen之外,還有其他方法可以轉到另一個屏幕嗎?
覆蓋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;
}
這是推動ListField項目點擊的另一個屏幕的唯一方法,這裏沒有人有魔杖..... – 2011-12-10 04:46:59
您可以在MainScreen的頂推MainScreen。你爲什麼不想使用pushScreen? – cjp 2011-02-19 00:12:44