1、Actionbar的形式:
final ActionBar actionBar = getActionBar();
actionBar.setNavigationMode(ActionBar.NAVIGATION_MODE_TABS);
NavigationMode有以下几种:
Constants | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
int | DISPLAY_HOME_AS_UP | Display the 'home' element such that it appears as an 'up' affordance. | |||||||||
int | DISPLAY_SHOW_CUSTOM | Show the custom view if one has been set. | |||||||||
int | DISPLAY_SHOW_HOME | Show 'home' elements in this action bar, leaving more space for other navigation elements. | |||||||||
int | DISPLAY_SHOW_TITLE | Show the activity title and subtitle, if present. | |||||||||
int | DISPLAY_USE_LOGO | Use logo instead of icon if available. | |||||||||
int | NAVIGATION_MODE_LIST | List navigation mode. | |||||||||
int | NAVIGATION_MODE_STANDARD | Standard navigation mode. | |||||||||
int | NAVIGATION_MODE_TABS | Tab navigation mode. |