Well I guess I ran into some bugs.
There seems to be a bug with Bitmaps in LayerLists: http://www.michaelpardo.com/2011/10/repeating-bitmaps-inside-layerlists/
I have Layer-List that I want to use as a Background-Drawable in my custom titlebar.
<style name="custom_titlebar_background">
<item name="android:background">@drawable/custom_titlebar_background</item>
</style>
EDIT:
To use the linked workaround I need to set the background of the titlebar programmatically, but I have no idea how. This doesn’t seem to work, It changes the background of the whole screen (including the actual content view):
LayerDrawable layer = (LayerDrawable)getResources().getDrawable(R.drawable.custom_titlebar_background);
setLayerDrawableBitmapsRepeating(layer);
getWindow().setBackgroundDrawable(layer);
Is there any way to get a reference to a custom titlebar to call setBackgroundDrawable() or any other way to set the background of a custom titlebar?
I found a solution. It is completely dirty and makes use of undocumented Members. This will work at least for me since my custom title bar is only use on 2.x devices to get a Holo-like Look.
It seems that the android title view has always the same id.
As long as you are not doing important stuff and your application will still work without it, I see no reason to not use this workaround to fix tileable bitmaps on older Android builds.