Android ActionBar setDisplayOptions 使用详解
先来看看官方文档的说明
setDisplayOptions
setDisplayOptions Added in API level 11
ActionBar 提供了下面几种模式,来设置导航栏的样式
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. // 自定义View |
int DISPLAY_SHOW_HOME | Show ‘home’ elements in this action bar, leaving more space for other navigation elements.//显示“主页”元素,为其他导航元素留出更多空间。这包括Icon和Logo |
int DISPLAY_SHOW_TITLE | Show the activity title and subtitle, if present |