Note that there are some explanatory texts on larger screens.

plurals
  1. POAndroid: when wrap_content doesn't just wrap its content?
    primarykey
    data
    text
    <p>I have a following xml layout in my project (incidentally, if you notice something else that is also seemingly wrong/not so good yet, I'd appreciate you let me know about it!) and my problem is the attribute "wrap_contents" doesn't work at the last TextView ("EEE", txt4). Is there any regulation I overlook?</p> <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt; &lt;merge xmlns:android="http://schemas.android.com/apk/res/android"&gt; &lt;TableLayout android:id="@+id/Table" android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_weight="1"&gt; &lt;TableRow android:id="@+id/tableRow1" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_gravity="center_vertical"&gt; &lt;TextView android:id="@+id/txt1" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_gravity="center_vertical" android:text="AAA" android:textColor="@color/white" /&gt; &lt;Spinner android:id="@+id/spn1" android:layout_width="fill_parent" android:layout_height="wrap_content" android:layout_weight="1" android:entries="@array/array1" /&gt; &lt;/TableRow&gt; &lt;TableRow android:id="@+id/tableRow2" android:layout_width="wrap_content" android:layout_height="wrap_content" &gt; &lt;TextView android:id="@+id/edt1" android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_gravity="center_vertical" android:text="BBB" android:textColor="@color/white" /&gt; &lt;Spinner android:id="@+id/spn2" android:layout_width="match_parent" android:layout_height="match_parent" android:layout_weight="1" android:entries="@array/Tounyuhou" /&gt; &lt;EditText android:id="@+id/edt2" android:layout_width="wrap_content" android:layout_height="wrap_content" android:ems="5" android:inputType="numberSigned"/&gt; &lt;TextView android:id="@+id/txt2" android:layout_width="wrap_content" android:layout_height="match_parent" android:text="CCC" android:textColor="@color/white" android:gravity="center_vertical|center_horizontal" android:textSize="18sp"/&gt; &lt;/TableRow&gt; &lt;TableRow android:id="@+id/tableRow3" android:layout_width="match_parent" android:layout_height="wrap_content"&gt; &lt;TextView android:id="@+id/txt3" android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_gravity="center_vertical|center_horizontal" android:text="DDD" android:textColor="@color/white" /&gt; &lt;EditText android:id="@+id/edt3" android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_weight="1" android:gravity="right|center_vertical"&gt; &lt;/EditText&gt; &lt;TextView android:id="@+id/txt4" android:layout_width="wrap_content" android:layout_height="match_parent" android:text="EEE" android:textColor="@color/white" android:gravity="center_vertical|center_horizontal" android:textSize="20sp"/&gt; &lt;/TableRow&gt; &lt;/TableLayout&gt; &lt;/merge&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.
    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