JakeWharton/ActionBarSherlock — Issue #225: Custom backgrounds not working on ICS
Author: JuhaniLehtimaeki
Created: 2012-02-08 10:56:20+00:00
State: open

We are using custom background drawables with ABS4. They work fine when running on Android 2.3 but on 4.0 the background drawables seem to be ignored. I've tried to make sure that we don't have problems in our definition code but as the behavior is different on two Android versions with the same code I think there might be an issue in the ABS code. We don't have any relevant platform specific style definitions in our code.

On 2.3 stacked mode & action mode

![2.3](https://lh3.googleusercontent.com/-2vffumX0Hbo/TzJQlLOIWtI/AAAAAAAAE-0/lhTJ-dWMUsI/s640/device-2012-02-08-112801.png)

![2.3](https://lh6.googleusercontent.com/-9PjFiHEobIk/TzJQkw_FODI/AAAAAAAAE-w/xCCtXqurP30/s640/device-2012-02-08-112815.png)

The very same code running on ICS

![4.0](https://lh6.googleusercontent.com/-mMHdpQ3FFds/TzJQlQKxZMI/AAAAAAAAE-4/U4c-j-BOHxY/s640/device-2012-02-08-112741.png)

![4.0](https://lh6.googleusercontent.com/-lukDE4g5WB8/TzJQlPUPEoI/AAAAAAAAE-8/lTe1UTbpMNs/s640/device-2012-02-08-112753.png)

XML definitions for the action bar style are:

---------
Now, if I add this code to my activity:

actionBar.setSplitBackgroundDrawable(getResources().getDrawable(R.drawable.actionbarbackground));
actionBar.setStackedBackgroundDrawable(getResources().getDrawable(R.drawable.actionbarbackground));
actionBar.setBackgroundDrawable(getResources().getDrawable(R.drawable.actionbarbackground));

it seems to enable top action bar bg drawable but everything else stays the same (action mode is still as above).

![4.0 with extra code](https://lh6.googleusercontent.com/--RnWEyy5_mo/TzJRgtAoCmI/AAAAAAAAE_k/Mvg2yXi52AY/s640/device-2012-02-08-114117.png)