WEB开发网
开发学院手机开发Android 开发 android 动态menu 阅读

android 动态menu

 2010-07-22 01:17:00 来源:WEB开发网   
核心提示:switch(gameState){case GAME_STATE_MENU:menu.setGroupVisible(MENU_GROUP_MENU, true);menu.setGroupVisible(MENU_GROUP_GAME, false);menu.setGroupVisible(MENU_GROUP_

switch(gameState)

{

case GAME_STATE_MENU:

menu.setGroupVisible(MENU_GROUP_MENU, true);

menu.setGroupVisible(MENU_GROUP_GAME, false);

menu.setGroupVisible(MENU_GROUP_HELP, false);

break;

case GAME_STATE_HELP:

menu.setGroupVisible(MENU_GROUP_MENU, false);

menu.setGroupVisible(MENU_GROUP_GAME, false);

menu.setGroupVisible(MENU_GROUP_HELP, true);

break;

case GAME_STATE_ABOUT:

menu.setGroupVisible(MENU_GROUP_MENU, false);

menu.setGroupVisible(MENU_GROUP_GAME, false);

menu.setGroupVisible(MENU_GROUP_HELP, true);

break;

default:

menu.setGroupVisible(MENU_GROUP_MENU, false);

menu.setGroupVisible(MENU_GROUP_GAME, true);

menu.setGroupVisible(MENU_GROUP_HELP, false);

break;

}

return true;

}

//点击菜单之后的效果

@Override

public boolean onOptionsItemSelected(MenuItem item) {

switch (item.getItemId()) {

case MENU_HELP:

//点击帮助菜单

initHelp();

return true;

case MENU_START:

initGame();

return true;

case MENU_ABOUT:

initAbout();

return true;

case MENU_OTHER:

return true;

case MENU_SET:

return true;

}

return false;

}

来自:http://www.mobilesdn.com/?action-viewnews-itemid-107

上一页  1 2 

Tags:android 动态 menu

编辑录入:coldstar [复制链接] [打 印]
赞助商链接