In my android application I want the standard/basic title bar to change color.
To change the text color you have setTitleColor(int color), is there a way to change the background color of the bar?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
This thread will get you started with building your own title bar in a xml file and using it in your activities
Edit
Here is a brief summary of the content of the link above – This is just to set the color of the text and the background of the title bar – no resizing, no buttons, just the simpliest sample
res/layout/mytitle.xml – This is the view that will represent the title bar
res/values/themes.xml – We want to keep the default android theme and just need to change the background color of the title background. So we create a theme that inherits the default theme and set the background style to our own style.
res/values/styles.xml – This is where we set the theme to use the color we want for the title background
res/values/colors.xml – Set here the color you want
In the AndroidMANIFEST.xml, set the theme attribute either in the application (for the whole application) or in the activity (only this activity) tags
From the Activity (called CustomTitleBar) :