cambiar la configuración de la barra de título (texto, color)

I am trying to change color of the WindowsTitlebar. I looked/read around and understood as below(code below in styles.xls added for this change)

     <!-- Application theme. -->
    <style name="AppTheme" parent="AppBaseTheme">
    <!-- All customizations that are NOT specific to a particular API-level can go here. --> 

</style>
 <style name="LargeTitleTheme" parent="AppBaseTheme">
   <item name="android:windowTitleSize">50dp</item>
   <item name="android:windowTitleStyle">@style/titleTextStyle</item>
   <item name="android:windowTitleBackgroundStyle">@style/WindowTitleBackground</item>
</style>

<style name="titleTextStyle" >
    <item name="android:textSize">30sp</item>
    <item name="android:textColor">#FFFFFF</item>
    <item name="android:gravity">center</item>

</style>
<style name="WindowTitleBackground">     
    <item name="android:background">#92D050</item>
</style>

And in androidmanifest.xml the rferece to thetheme below

 android:theme="@style/LargeTitleTheme">

But this does not seem to be working Not sure where am I going wrong here. Need help here.

preguntado el 17 de mayo de 13 a las 08:05

2 Respuestas

I used this for custom title

<style name="CustomWindowTitleBackground">
    <item name="android:background">#404040</item>
    <item name="android:textColor">#FFFFFF</item>
</style>

<style name="CustomTheme" parent="android:Theme">
    <item name="android:windowTitleSize">30dp</item>
    <item name="android:windowTitleBackgroundStyle">@style/CustomWindowTitleBackground</item>
</style>

I got help from this aquí

contestado el 17 de mayo de 13 a las 09:05

when I used the code you shared, the color change happens but the app icon and the appname disappear from my title bar. - user1938357

I just gave an example .. if you see the link i provided in answer.. you can find a details - púas

The problem looks to be with the parent attribute for my theme. using parent="AppTheme" shows the icon+name in title but color chage does no show. Using parent="android:Theme" shows color change but icon/appname vanish. - user1938357

changing parent to parent="android:Theme.light" solved the problem for now

contestado el 18 de mayo de 13 a las 05:05

No es la respuesta que estás buscando? Examinar otras preguntas etiquetadas or haz tu propia pregunta.