I'm adding a custom img to the header title but no matter what I do I still have a small gap on each side of the img (also shown in this question)
Here is the xml in my strings.xml file
<?xml version="1.0" encoding="utf-8"?>
<resources>
<string name="hello"></string>
<string name="app_name"></string>
<style name="LargeTitleTheme" parent="android:Theme.Light">
<item name="android:windowTitleSize">44dip</item>
</style>
</resources>
Here is the code in my activity (ignore the slop - desperate coding at this point)
ViewGroup decorView = (ViewGroup) this.getWindow().getDecorView();
LinearLayout root = (LinearLayout) decorView.getChildAt(0);
FrameLayout titleContainer = (FrameLayout) root.getChildAt(0);
TextView title = (TextView) titleContainer.getChildAt(0);
title.setGravity(Gravity.CENTER);
Drawable drawable = getResources().getDrawable(R.drawable.nav);
drawable.setBounds(0,0,0,0);
title.setBackgroundDrawable(drawable);
title.setPadding(0,0,0,0);
title.setIncludeFontPadding(false);