在我的应用程序中,我使用了ActionBarSherlock库。另外我正在使用自定义标题栏。 这里去我的onCreate:您不能将自定义标题与其他标题功能结合起来
requestWindowFeature(Window.FEATURE_CUSTOM_TITLE);
setContentView(R.layout.main_tab);
getWindow().setFeatureInt(Window.FEATURE_CUSTOM_TITLE, R.layout.custom_title);
在我styles.mxl
<style name="MyTheme" parent="Theme.Sherlock">
<item name="android:background">#ff888888</item>
<item name="android:windowNoTitle">false</item>
<item name="android:windowTitleSize">50dp</item>
<item name="android:windowTitleBackgroundStyle">@style/windowTitleBackgroundStyle</item>
</style>
<style name="windowTitleBackgroundStyle">
<item name="android:background">#00688B</item>
</style>
清单文件,我使用的MyTheme的活动。
android:theme="@style/MyTheme"
该代码具有较低的Android版本正确工作(我曾与GB2.3.5测试)。但是,当我用ICS测试时,它与下面的错误崩溃: “你不能合并自定义标题与其他标题功能” 我在StackOVerflow讨论彻底,但无法解决问题。 解决方案尝试: 1)假 2)没有值-V11文件夹
检查此:http://stackoverflow.com/questions/13197345/cannot-combine-custom-titles-with-other-title-features – Waqas 2013-03-02 06:18:10
嗨Waqas,我检查了上述链接,但无法获得任何解。我需要有一个带有两个图标和标题文字的自定义标题。正如概率中提到的,我正在使用actionbarsherlock。 – basu 2013-03-02 08:47:09
在我的情况下,我得到了这个错误,因为我在清单中为LAUNCHER活动指定了android:theme =“@ style/Theme.Transparent” 。我删除了该行,它工作。 <“:windowActionBar机器人”项目名称=>假的风格,而不是使用.NoActionBar,因为后者包括 – 2013-07-13 01:50:56