报错】android.util.AndroidRuntimeException: You cannot combine custom titles with other title features
造成这个出错的原因是因为在代码中使用了:
- this.requestWindowFeature(Window.FEATURE_CUSTOM_TITLE);
- this.requestWindowFeature(Window.FEATURE_CUSTOM_TITLE);
解决办法就是:
1。在AndroidManifest.xml 中更改<application>标签中的android:theme="@style/AppTheme"(自定义主题时候),根据自己需要更改。
2。或者直接删除掉\res\values-v11和v11+(系统默认的对你没有用处时)。
=======================================================================================================
android4.0以后使用自定view来自定义设置标题
ActionBar actionBar = this.getActionBar();
actionBar.setCustomView(R.layout.title_bar);
actionBar.setDisplayShowCustomEnabled(true);
actionBar.setDisplayShowHomeEnabled(false);
actionBar.show();