0

If I use one of the many tutorials on creating custom titlebars it seems to change the rest of the theme.

default theme

theme after custom titlebar

How can I change the titlebar with out it changing the rest of the theme eg the menu menu and the edittext boxes etc

    //mainactivity.java
    requestWindowFeature(Window.FEATURE_CUSTOM_TITLE);
    setContentView(R.layout.activity_main);
    getWindow().setFeatureInt(Window.FEATURE_CUSTOM_TITLE, R.layout.customtitlebar);

    //manifest.
    <application
    android:allowBackup="true"
    android:icon="@drawable/ic_launcher"
    android:label="@string/app_name"
    android:theme="@style/AppTheme">
    <activity
        android:name="com.MediocreFireworks.cheapchug.MainActivity"
        android:label="@string/app_name" 
        android:theme="@style/CustomTheme">
        <intent-filter>
            <action android:name="android.intent.action.MAIN" />
            <category android:name="android.intent.category.LAUNCHER" />
        </intent-filter>
    </activity>


    //style.xml
    <style name="CustomWindowTitleBackground">
    <item name="android:background">#323331</item>
    </style>

    <style name="CustomTheme" parent="android:Theme.Light">
    <item name="android:windowTitleSize">35dip</item>
    <item name="android:windowTitleBackgroundStyle">@style/CustomWindowTitleBackground</item>
Ahmad
  • 69,608
  • 17
  • 111
  • 137
Thomas
  • 435
  • 6
  • 20
  • Are you alright with getting rid of it and making your own? – Hyrum Hammon Jul 11 '13 at 02:46
  • do you mean just removing the title bar then adding in a layout to the top of the screen to act as a title bar? – Thomas Jul 11 '13 at 02:49
  • Yes. This will also allow you to add buttons to it. I just don't know if that's what you want. – Hyrum Hammon Jul 11 '13 at 02:50
  • i want say [this](http://www.londatiga.net/it/how-to-create-custom-window-title-in-android/) title bar but without it changing all the menus and widget styles. It doesn't seem right to bypass the titlebar part that google have done? or is that what most people do? – Thomas Jul 11 '13 at 03:05
  • I don't know what most do :\ but it shouldn't be a problem. I can't help you too much with styles, I focus on Java and have a designer for everything else. – Hyrum Hammon Jul 11 '13 at 03:15

1 Answers1

0

ok so figured it out, I needed to use the android:Theme.Holo.Light which is the latest theme. and also use the different styles.xml in the values folder for different api's

Thomas
  • 435
  • 6
  • 20