android:showAsAction让Menu如何显示,分为四种:
ifRoom;always;never;withText
ifRoom表示如果有空间就显示
always表示总是显示
never则会在最右边的其他Menu的列表中显示
withText无非就是显示加上Text
如果希望使用Action Bar的API,例如添加标签或是修改Action Bar风格,就需要将android:minSdkVersion设为“11”,这样才能使用ActionBar类
ActionBar的样式目前只知道能从Manifest中通过android:theme来指定自定义的theme来操作,可以使用
android:theme=”@style/Theme.Holo.Light.DarkActionBar
可能出现的问题
1. 关于“you need to use a theme.appcompat theme(or descendant) with this activity" 错误
http://blog.csdn.net/u012336923/article/details/39496915 --author yao伟斌
2. Unable to execute dex: Multiple dex files define Landroid/support/v7/app/ActionBar$Callback;
右键-》property-》java build path-》Order and Export-》把带勾的项全部取消勾选 即可;