【问题标题】:You cannot combine custom titles with other features您不能将自定义标题与其他功能结合使用
【发布时间】:2013-08-29 01:47:24
【问题描述】:

我在我的 android 应用程序中使用自定义标题,方法是在我的活动中调用 getWindow().setFeatureInt(Window.FEATURE_CUSTOM_TITLE, R.layout.window_title);

在我的清单中,我将主题设置为-android:theme="@style/AppTheme" >

style.xml 中的 AppTheme -

 <style name="AppTheme" parent="AppBaseTheme">
    <!-- All customizations that are NOT specific to a particular API-level can go here. -->
    <item name="android:windowTitleSize">40dip</item>
    <item name="android:windowTitleBackgroundStyle">@style/CustomWindowTitleBackground</item>
</style>

应用基础主题继承 - android:Theme.Holo.Light

此代码在 Android 版本低于 4 的设备上运行良好,但是当我尝试在高于 4 或 4.0 的设备上运行它时,我收到错误消息 - “您无法将自定义标题与其他标题功能结合使用”我在 StackOVerflow 中进行了深入研究讨论,但无法解决问题。

对此有何建议??

【问题讨论】:

    标签: android android-layout


    【解决方案1】:

    完成!!

    通过添加&lt;item name="android:windowActionBar"&gt;false&lt;/item&gt;解决了这个错误

    <style name="AppTheme" parent="AppBaseTheme"> <item name="android:windowTitleSize">40dip</item> <item name="android:windowTitleBackgroundStyle">@style/CustomWindowTitleBackground</item> <item name="android:windowActionBar">false</item> </style>

    谢谢!! :)

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多