Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Does Holo Theme work with custom titlebar?

Tags:

android

I've got an application that draws a custom title bar using the following style for the application theme:

<style name="App_Theme" parent="android:Theme">
    <item name="android:windowTitleSize">30dip</item>
    <item name="android:windowTitleBackgroundStyle">@style/App_TitleBackground</item>
</style>

This does not give me the holo theme. So I set the to parent="@android:style/Theme.Holo". This crashes the application with the following error:

E/AndroidRuntime(2048): Caused by: android.util.AndroidRuntimeException: You cannot combine custom titles with other title features

Is it disallowed to use custom title bar using:

 requestWindowFeature(Window.FEATURE_CUSTOM_TITLE);

Or am I missing something here?

PS:

  • The code works perfectly fine with the parent set to "Android:Theme".
  • I'm using API Level 14
  • like image 210
    Code Poet Avatar asked Nov 25 '11 12:11

    Code Poet


    2 Answers

    Let your activity use a theme with following attribute:

    <item name="android:windowActionBar">false</item>
    
    like image 81
    mido Avatar answered Oct 19 '22 05:10

    mido


    mido is correct

    <item name="android:windowActionBar">false</item>
    

    is the solution when using @android:style/Theme.Holo (default for ICS).

    One observation, if you use @android:style/Theme.Holo.NoActionBar change it back to the default @android:style/Theme.Holo.

    like image 28
    adex08 Avatar answered Oct 19 '22 06:10

    adex08