Note that there are some explanatory texts on larger screens.

plurals
  1. POButton alignment is gone when app is displayed Horizontally
    primarykey
    data
    text
    <p>I have developed an app, which look like below, in vertical view.</p> <p><img src="https://i.stack.imgur.com/z9xia.png" alt="enter image description here"></p> <p>This is the code of this app</p> <pre><code>&lt;RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" android:layout_width="fill_parent" android:layout_height="fill_parent" android:paddingTop="@dimen/activity_vertical_margin" tools:context=".HomeScreen" &gt; &lt;TableLayout android:layout_width="fill_parent" android:layout_height="fill_parent" android:stretchColumns="*" android:weightSum="4" &gt; &lt;TableRow android:id="@+id/tableRow1" android:layout_width="wrap_content" android:layout_height="fill_parent" android:layout_weight="1" &gt; &lt;Button android:id="@+id/fBtn" android:layout_width="wrap_content" android:layout_height="fill_parent" android:drawableTop="@drawable/ic_launcher" android:layout_weight=".3" android:textAppearance="?android:attr/textAppearanceSmall" android:text="@string/fStr" /&gt; &lt;Button android:id="@+id/rBtn" android:layout_width="wrap_content" android:layout_height="fill_parent" android:drawableTop="@drawable/ic_launcher" android:layout_weight=".3" android:textAppearance="?android:attr/textAppearanceSmall" android:text="@string/rStr" /&gt; &lt;Button android:id="@+id/sBtn" android:layout_width="wrap_content" android:layout_height="fill_parent" android:drawableTop="@drawable/ic_launcher" android:layout_weight=".3" android:textAppearance="?android:attr/textAppearanceSmall" android:text="@string/sStr" /&gt; &lt;/TableRow&gt; &lt;TableRow android:id="@+id/tableRow2" android:layout_width="wrap_content" android:layout_height="fill_parent" android:layout_weight="1" &gt; &lt;Button android:id="@+id/cBtn" android:layout_width="wrap_content" android:layout_height="fill_parent" android:drawableTop="@drawable/ic_launcher" android:layout_weight=".3" android:textAppearance="?android:attr/textAppearanceSmall" android:text="@string/cStr" /&gt; &lt;Button android:id="@+id/aBtn" android:layout_width="wrap_content" android:layout_height="fill_parent" android:drawableTop="@drawable/ic_launcher" android:layout_weight=".3" android:textAppearance="?android:attr/textAppearanceSmall" android:text="@string/aStr" /&gt; &lt;Button android:id="@+id/lBtn" android:layout_width="wrap_content" android:layout_height="fill_parent" android:drawableTop="@drawable/ic_launcher" android:layout_weight=".3" android:textAppearance="?android:attr/textAppearanceSmall" android:text="@string/lStr" /&gt; &lt;/TableRow&gt; &lt;TableRow android:id="@+id/tableRow3" android:layout_width="wrap_content" android:layout_height="fill_parent" android:layout_weight="1" &gt; &lt;Button android:id="@+id/oBtn" android:layout_width="wrap_content" android:layout_height="fill_parent" android:drawableTop="@drawable/ic_launcher" android:layout_weight=".3" android:textAppearance="?android:attr/textAppearanceSmall" android:text="@string/oStr" /&gt; &lt;Button android:id="@+id/tBtn" android:layout_width="wrap_content" android:layout_height="fill_parent" android:drawableTop="@drawable/ic_launcher" android:layout_weight=".3" android:textAppearance="?android:attr/textAppearanceSmall" android:text="@string/tStr" /&gt; &lt;Button android:id="@+id/eBtn" android:layout_width="wrap_content" android:layout_height="fill_parent" android:drawableTop="@drawable/ic_launcher" android:layout_weight=".3" android:textAppearance="?android:attr/textAppearanceSmall" android:text="@string/eStr" /&gt; &lt;/TableRow&gt; &lt;TableRow android:id="@+id/tableRow4" android:layout_width="wrap_content" android:layout_height="fill_parent" android:layout_weight="1" &gt; &lt;Button android:id="@+id/dBtn" android:layout_width="wrap_content" android:layout_height="fill_parent" android:drawableTop="@drawable/ic_launcher" android:layout_weight=".3" android:textAppearance="?android:attr/textAppearanceSmall" android:text="@string/dStr" /&gt; &lt;Button android:id="@+id/hBtn" android:layout_width="wrap_content" android:layout_height="fill_parent" android:drawableTop="@drawable/ic_launcher" android:layout_weight=".3" android:textAppearance="?android:attr/textAppearanceSmall" android:text="@string/hStr" /&gt; &lt;Button android:id="@+id/aaBtn" android:layout_width="wrap_content" android:layout_height="fill_parent" android:drawableTop="@drawable/ic_launcher" android:layout_weight=".3" android:textAppearance="?android:attr/textAppearanceSmall" android:text="@string/aStr" /&gt; &lt;/TableRow&gt; &lt;/TableLayout&gt; &lt;/RelativeLayout&gt; </code></pre> <p><strong>strings.xml</strong></p> <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt; &lt;resources&gt; &lt;string name="fStr"&gt;Fffffffff&lt;/string&gt; &lt;string name="rStr"&gt;Rrrrrr&lt;/string&gt; &lt;string name="sStr"&gt;Ssssss &lt;/string&gt; &lt;string name="lStr"&gt;Lllll&lt;/string&gt; &lt;string name="oStr"&gt;Oooooooooooo&lt;/string&gt; &lt;string name="tStr"&gt;Ttttt&lt;/string&gt; &lt;string name="eStr"&gt;Eeeeee&lt;/string&gt; &lt;string name="dStr"&gt;Dddddddddd&lt;/string&gt; &lt;string name="cStr"&gt;Cccccccc&lt;/string&gt; &lt;string name="hStr"&gt;Hhhh&lt;/string&gt; &lt;string name="aStr"&gt;Aaaaaaaaaa aaaa&lt;/string&gt; &lt;/resources&gt; </code></pre> <p>This app has 2 issues. </p> <ol> <li>The gap between button image and text is too much</li> <li>When the app is in horizontal view, the entire alignment is messed up, and get displayed as below.</li> </ol> <p><img src="https://i.stack.imgur.com/T4hY9.png" alt="enter image description here"></p> <p>As you can see, there is not text!</p> <p>How can I solve this issue?</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.
 

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