Note that there are some explanatory texts on larger screens.

plurals
  1. POAndroid - Remove padding from button
    primarykey
    data
    text
    <p>How can I remove the padding from a <code>Button</code> view? At least I need to have equal padding on all sides no matter what.</p> <p>I have this</p> <pre><code>&lt;Button style="@style/btnStart" android:text="@string/start" /&gt; </code></pre> <p>And this style</p> <pre><code>&lt;style name="btnStart" parent="@android:style/Widget.Button"&gt; &lt;item name="android:background"&gt;@drawable/selector_start_button&lt;/item&gt; &lt;item name="android:textColor"&gt;@drawable/selector_start_button_text&lt;/item&gt; &lt;item name="android:layout_width"&gt;wrap_content&lt;/item&gt; &lt;item name="android:layout_height"&gt;wrap_content&lt;/item&gt; &lt;item name="android:textSize"&gt;24sp&lt;/item&gt; &lt;/style&gt; </code></pre> <p>And this drawable <code>selector_start_button.xml</code></p> <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt; &lt;selector xmlns:android="http://schemas.android.com/apk/res/android"&gt; &lt;item android:state_pressed="true"&gt; &lt;shape&gt; &lt;solid android:color="@color/start_button" /&gt; &lt;stroke android:color="@color/start_button" android:width="1dp" /&gt; &lt;padding android:left="0dp" android:top="0dp" android:right="0dp" android:bottom="0dp" /&gt; &lt;/shape&gt; &lt;/item&gt; &lt;item&gt; &lt;shape&gt; &lt;solid android:color="#00000000" /&gt; &lt;stroke android:color="@color/start_button" android:width="1dp" /&gt; &lt;padding android:left="0dp" android:top="0dp" android:right="0dp" android:bottom="0dp" /&gt; &lt;/shape&gt; &lt;/item&gt; &lt;/selector&gt; </code></pre> <p>But I still get this</p> <p><img src="https://i.imgur.com/cwONY6c.png" alt="button with unwanted padding"></p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

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