Note that there are some explanatory texts on larger screens.

plurals
  1. POChanging height of buttons
    primarykey
    data
    text
    <p>I'm trying to change the height of a couple of buttons in my app.</p> <p><img src="https://i.stack.imgur.com/wO1cR.jpg" alt="my app screenshot"></p> <p>I have tried setting <code>@android:color/transparent</code> as the <code>android:background</code> and I have also tried setting a <code>layout_height</code> to values like <code>16dp</code>.</p> <p>How could I give my buttons a smaller height?</p> <p>Here is the style xml:</p> <pre><code>&lt;style name="Theme.PMBAppTheme.TextButton"&gt; &lt;item name="android:textStyle"&gt;bold&lt;/item&gt; &lt;item name="android:textSize"&gt;14sp&lt;/item&gt; &lt;item name="android:textColor"&gt;@drawable/text_button_text&lt;/item&gt; &lt;item name="android:background"&gt;#ff3300&lt;/item&gt; &lt;item name="android:padding"&gt;0dp&lt;/item&gt; &lt;item name="android:height"&gt;20sp&lt;/item&gt; &lt;/style&gt; </code></pre> <p>And the layout:</p> <pre><code> &lt;Button android:layout_width="wrap_content" android:layout_height="wrap_content" android:id="@+id/register_btn_privacy" android:text="@string/privacy_policy" style="@style/Theme.PMBAppTheme.TextButton" /&gt; </code></pre> <p><code>text_button_text</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_focused="true" android:state_pressed="true" android:color="@color/muted_pink_over" /&gt; &lt;item android:state_focused="false" android:state_pressed="true" android:color="@color/muted_pink_over" /&gt; &lt;item android:color="@color/muted_pink" /&gt; &lt;/selector&gt; </code></pre>
    singulars
    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.
 

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