Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>Remember below about TableLayout.</p> <p>A layout that arranges its children horizontally. A TableRow should always be used as a child of a TableLayout. If a TableRow's parent is not a TableLayout, the TableRow will behave as an horizontal LinearLayout.</p> <p>The children of a TableRow do not need to specify the layout_width and layout_height attributes in the XML file. TableRow always enforces those values to be respectively MATCH_PARENT and WRAP_CONTENT.</p> <p>I used your layout and removed some of the attributes.It is working now. You cna do one thing, try to add the deleted attributes one by one and check the validity using the graphic layout tab.</p> <pre><code>&lt;TableLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" android:id="@+id/TableLayout" android:layout_width="fill_parent" android:layout_height="fill_parent" android:gravity="left" tools:context=".MainActivity" &gt; &lt;TableRow android:id="@+id/tableRow0" android:layout_width="wrap_content" android:layout_height="wrap_content" &gt; &lt;TextView android:id="@+id/introductionTextView" android:layout_width="wrap_content" android:layout_height="wrap_content" /&gt; &lt;/TableRow&gt; &lt;TableRow android:id="@+id/tableRow1" android:layout_width="wrap_content" android:layout_height="wrap_content" &gt; &lt;TextView android:id="@+id/heightPromptTextView" android:layout_width="match_parent" android:layout_height="wrap_content" /&gt; &lt;/TableRow&gt; &lt;TableRow android:id="@+id/tableRow2" android:layout_width="wrap_content" android:layout_height="wrap_content" &gt; &lt;EditText android:id="@+id/feetPortionOfHeightEditText" android:layout_width="fill_parent" android:layout_height="fill_parent" /&gt; &lt;TextView android:id="@+id/feetPortionOfHeightViewText" android:layout_width="wrap_content" android:layout_height="fill_parent" /&gt; &lt;EditText android:id="@+id/inchesPortionOfHeightEditText" android:layout_width="fill_parent" android:layout_height="fill_parent" android:layout_weight="1" android:ems="10" android:inputType="number" /&gt; &lt;TextView android:id="@+id/inchesPortionOfHeightViewText" android:layout_width="wrap_content" android:layout_height="fill_parent" android:layout_weight="0" android:gravity="center_vertical" android:padding="5sp" android:paddingRight="5sp" /&gt; &lt;/TableRow&gt; &lt;TableRow android:id="@+id/tableRow3" android:layout_width="wrap_content" android:layout_height="wrap_content" &gt; &lt;TextView android:id="@+id/weightPromptTextView" android:layout_width="match_parent" android:layout_height="match_parent" /&gt; &lt;/TableRow&gt; &lt;TableRow android:id="@+id/tableRow4" android:layout_width="wrap_content" android:layout_height="wrap_content" android:padding="5sp" android:paddingLeft="20sp" &gt; &lt;EditText android:id="@+id/weightEditText" android:layout_width="fill_parent" android:layout_height="fill_parent" android:inputType="number" &gt; &lt;/EditText&gt; &lt;TextView android:id="@+id/weightTextView" android:layout_width="fill_parent" android:layout_height="fill_parent" /&gt; &lt;/TableRow&gt; &lt;TableRow android:id="@+id/tableRow5" android:layout_width="wrap_content" android:layout_height="wrap_content" android:padding="5sp" &gt; &lt;Button android:id="@+id/calculateButton" android:layout_width="fill_parent" android:layout_height="fill_parent" /&gt; &lt;/TableRow&gt; &lt;TableRow android:id="@+id/tableRow6" android:layout_width="wrap_content" android:layout_height="wrap_content" android:padding="5sp" &gt; &lt;TextView android:id="@+id/bmiResultTextView" android:layout_width="fill_parent" android:layout_height="fill_parent" /&gt; &lt;/TableRow&gt; &lt;TableRow android:id="@+id/tableRow7" android:layout_width="wrap_content" android:layout_height="wrap_content" &gt; &lt;TextView android:id="@+id/bmiResultCommentsTextView" android:layout_width="fill_parent" android:layout_height="fill_parent" /&gt; &lt;/TableRow&gt; &lt;/TableLayout&gt; </code></pre>
    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.
    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