1

Can the background for the CAB (contextual action bar) in android, be changed? I am using it in my application, and when the application is installed on a tablet (3.0 - 3.2 API) the CAB has a yellow color and one look, and when the application is installed on phone with 4.0+ API it has some kind of blue background and another look. Can I do sth about this and have the same look everywhere?

note: my application is intended to run on 3.0+ api's

Sandra
  • 4,239
  • 10
  • 47
  • 80
  • Can you please post your solution if you have found it? – andro Jan 26 '13 at 21:46
  • Look in the source for the Google IO 2012 app, and also this link [http://stackoverflow.com/questions/11085308/changing-the-background-drawable-of-the-searchview-widget]. Here you have an explanation of the customizations of the action bar, but you can get an idea for the CAB also. Hope that helps. – Sandra Jan 28 '13 at 09:23

1 Answers1

0

You could do this by defining your own themes. Use one of the standard themes (in your case you can use Theme.Holo since you are targeting Honeycomb+) as a start point and customize (i.e., override) those pieces that you want to change. In your case you would customize just the style for the CAB.

The Styles and Themes section of Android dev site introduces you to this in brief. Two additional places to look for real world example of how this has been done are:

  1. Actionbar Sherlock. Look at the actual library source (rather than the samples).
  2. Google IO 2012 app.
curioustechizen
  • 10,572
  • 10
  • 61
  • 110