Note that there are some explanatory texts on larger screens.

plurals
  1. POCreate custom titlebar in Android
    primarykey
    data
    text
    <p>I created a custom title bar for my application but I am having some problems implementing it. I want to change the color and the appearance for the text and title bar</p> <p>The layout of the styles.xml is as below:</p> <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt; &lt;resources&gt; &lt;style name="MyTheme"&gt; &lt;item name="android:tabWidgetStyle"&gt;@style/LightTabWidget&lt;/item&gt; &lt;/style&gt; &lt;style name="MyWindowTitleBackground" parent="@android:style/WindowTitleBackground"&gt; &lt;item name="android:background"&gt;@android:drawable/title_bar&lt;/item&gt; &lt;/style&gt; &lt;style name="MyWindowTitle" parent="@android:style/WindowTitle"&gt; &lt;item name="android:singleLine"&gt;true&lt;/item&gt; &lt;item name="android:windowTitleSize"&gt;40dip&lt;/item&gt; &lt;item name="android:textAppearance"&gt;@style/MyTextAppearance&lt;/item&gt; &lt;item name="android:shadowColor"&gt;#BB000000&lt;/item&gt; &lt;item name="android:shadowRadius"&gt;2.75&lt;/item&gt; &lt;/style&gt; &lt;style name="MyTextAppearance" parent="@android:style/TextAppearance.WindowTitle"&gt; &lt;item name="android:textColor"&gt;#3A6629&lt;/item&gt; &lt;item name="android:textSize"&gt;14sp&lt;/item&gt; &lt;item name="android:textStyle"&gt;bold&lt;/item&gt; &lt;/style&gt; &lt;style name="LightTabWidget" parent="@android:style/Widget.TabWidget"&gt; &lt;item name="android:textSize"&gt;20px&lt;/item&gt; &lt;item name="android:textStyle"&gt;bold&lt;/item&gt; &lt;item name="android:textColor"&gt;#FF5721&lt;/item&gt; &lt;/style&gt; &lt;/resources&gt; </code></pre> <p>And I have added that theme in the manifest file as follows:</p> <pre><code> &lt;application android:icon="@drawable/icon" android:label="@string/app_name" android:theme="@android:style/Theme.Light"&gt; &lt;activity android:name="LAFoodBankAboutUs" android:label="@string/app_name" android:theme="@style/MyTheme"&gt; </code></pre> <p>What do I have to do to show the custom title bar?</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload