In my styles.xml file I have a style to remove the title bar and other styles to change my tabwidget’s font size:
<?xml version="1.0" encoding="utf-8"?>
<style name="RemoveTitleBar" parent="android:Theme">
<item name="android:style/Theme.Black.NoTitleBar.Fullscreen">true</item>
<item name="android:windowNoTitle">true</item>
</style>
<style name="CustomTheme" parent="android:style/Theme">
<item name="android:tabWidgetStyle">@style/CustomTabWidget</item>
</style>
<style name="CustomTabWidget" parent="android:style/Widget.TabWidget">
<item name="android:textAppearance">@style/CustomTabWidgetText</item>
</style>
<style name="CustomTabWidgetText" parent="android:style/TextAppearance.Widget.TabWidget">
<item name="android:textSize">12sp</item>
<item name="android:textStyle">bold</item>
</style>
In my AndroidManifest.xml file I set the RemoveTitleBar style to the application which works fine:
<application
android:icon="@drawable/ic_launcher_test_icon"
android:label="@string/app_name"
android:theme="@style/RemoveTitleBar"
....
However when I apply the CustomTheme style to my activity with tabs, I get the title bar back. But if I remove the line it works fine.
<activity android:name=".TabActivity"
android:label="@string/app_name"
android:screenOrientation="portrait"
android:theme="@style/CustomTheme"> </activity>
Am I going about this the wrong way or do I have to change something in my styles.xml file? Thanks for you time.
You are extending
CustomThemewith"android:style/Theme":and the
titleBaris available in in this you aren’t removing thetitleBar, you will again need to remove thetitleBarlike this: