Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>This is how I was able to set the padding between the home icon and the title.</p> <pre><code>ImageView view = (ImageView)findViewById(android.R.id.home); view.setPadding(left, top, right, bottom); </code></pre> <p>I couldn't find a way to customize this via the ActionBar xml styles though. That is, the following XML doesn't work:</p> <pre><code>&lt;style name="ActionBar" parent="android:style/Widget.Holo.Light.ActionBar"&gt; &lt;item name="android:titleTextStyle"&gt;@style/ActionBarTitle&lt;/item&gt; &lt;item name="android:icon"&gt;@drawable/ic_action_home&lt;/item&gt; &lt;/style&gt; &lt;style name="ActionBarTitle" parent="android:style/TextAppearance.Holo.Widget.ActionBar.Title"&gt; &lt;item name="android:textSize"&gt;18sp&lt;/item&gt; &lt;item name="android:paddingLeft"&gt;12dp&lt;/item&gt; &lt;!-- Can't get this padding to work :( --&gt; &lt;/style&gt; </code></pre> <p>However, if you are looking to achieve this through xml, these two links might help you find a solution:</p> <p><a href="https://github.com/android/platform_frameworks_base/blob/master/core/res/res/values/styles.xml" rel="noreferrer">https://github.com/android/platform_frameworks_base/blob/master/core/res/res/values/styles.xml</a></p> <p>(This is the actual layout used to display the home icon in an action bar) <a href="https://github.com/android/platform_frameworks_base/blob/master/core/res/res/layout/action_bar_home.xml" rel="noreferrer">https://github.com/android/platform_frameworks_base/blob/master/core/res/res/layout/action_bar_home.xml</a> </p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload