Note that there are some explanatory texts on larger screens.

plurals
  1. POHow to create small buttons with large text in Android 2.2?
    primarykey
    data
    text
    <p>I need to create fixed size sqare buttons with relatively large characters on them for a calculator app. When I increase text size, the character is no more displayed in the center of the button and the button's position gets shifted some pixels to the top (very strange).</p> <p><a href="http://img9.imageshack.us/i/buttontest.png/" rel="nofollow noreferrer">http://img9.imageshack.us/i/buttontest.png/</a></p> <p>If it's possible I don't want to use images for the buttons.</p> <p>Update:</p> <p>I use this xml:</p> <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt; &lt;TableLayout xmlns:android="http://schemas.android.com/apk/res/android" android:id="@+id/TableLayout01" android:layout_width="wrap_content" android:layout_height="wrap_content"&gt; &lt;TableRow&gt; &lt;Button android:layout_width="50dp" android:layout_height="50dp" android:text="1" android:textSize="8dp"&gt;&lt;/Button&gt; &lt;Button android:layout_width="50dp" android:layout_height="50dp" android:text="2" android:textSize="10dp"&gt;&lt;/Button&gt; &lt;Button android:layout_width="50dp" android:layout_height="50dp" android:text="3" android:textSize="12dp"&gt;&lt;/Button&gt; &lt;Button android:layout_width="50dp" android:layout_height="50dp" android:text="4" android:textSize="14dp"&gt;&lt;/Button&gt; &lt;Button android:layout_width="50dp" android:layout_height="50dp" android:text="5" android:textSize="16dp"&gt;&lt;/Button&gt; &lt;Button android:layout_width="50dp" android:layout_height="50dp" android:text="6" android:textSize="18dp"&gt;&lt;/Button&gt; &lt;/TableRow&gt;&lt;TableRow&gt; &lt;Button android:layout_width="50dp" android:layout_height="50dp" android:text="7" android:textSize="20dp"&gt;&lt;/Button&gt; &lt;Button android:layout_width="50dp" android:layout_height="50dp" android:text="8" android:textSize="22dp"&gt;&lt;/Button&gt; &lt;Button android:layout_width="50dp" android:layout_height="50dp" android:text="9" android:textSize="24dp"&gt;&lt;/Button&gt; &lt;Button android:layout_width="50dp" android:layout_height="50dp" android:text="A" android:textSize="26dp"&gt;&lt;/Button&gt; &lt;Button android:layout_width="50dp" android:layout_height="50dp" android:text="B" android:textSize="28dp"&gt;&lt;/Button&gt; &lt;Button android:layout_width="50dp" android:layout_height="50dp" android:text="C" android:textSize="30dp"&gt;&lt;/Button&gt; &lt;/TableRow&gt; &lt;TableRow&gt;&lt;/TableRow&gt; &lt;/TableLayout&gt; </code></pre> <p>And get this result:</p> <p><img src="https://i.stack.imgur.com/RcJ2g.png" alt="alt text"></p> <p>how do I get all buttons equallly arranged with centered text?</p>
    singulars
    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