Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>First of all, Why do u need <code>LinearLayout</code> inside <code>ScrollView</code>? <code>TableLayout</code> will spread rows vertically without <code>LinearLayout</code>.</p> <p>Second - a ton of views will <strong>significantly</strong> slow down application performance. Consider replacing <code>TableLayout</code> to.. maybe a <code>ListView</code> or code your own component. As i understand you need a simple table with <em>text-only</em> fields - it's not so hard to implement a single, fast and simple to use component.</p> <p>Third - the solution - just place header row outside ScrollView, like this:</p> <pre><code>&lt;HorizontalScrollView xmlns:android="http://schemas.android.com/apk/res/android" android:id="@+id/horizontalScrollView1" android:layout_width="match_parent" android:layout_height="match_parent" android:background="@drawable/background"&gt; &lt;TableLayout android:id="@+id/TLArchiveHeader" android:layout_height="wrap_content" android:layout_width="match_parent"&gt; &lt;TableRow style="@style/HeaderRow"&gt; &lt;TextView style="@style/HeaderText" android:layout_width="200dp" android:text="Owner name"/&gt; &lt;TextView style="@style/HeaderText" android:layout_width="200dp" android:text="Phone" /&gt; &lt;TextView style="@style/HeaderText" android:layout_width="200dp" android:text="Address" /&gt; &lt;TextView style="@style/HeaderText" android:layout_width="200dp" android:text="Mail" /&gt; &lt;TextView style="@style/HeaderText" android:layout_width="200dp" android:text="Fax" /&gt; &lt;/TableRow&gt; &lt;/TableLayout&gt; &lt;ScrollView android:id="@+id/scrollViewPhysicalExam" android:layout_width="match_parent" android:layout_height="match_parent"&gt; &lt;TableLayout android:id="@+id/TLArchiveRowPlaceholder" android:layout_height="wrap_content" android:layout_width="match_parent"&gt; &lt;/TableLayout&gt; &lt;/ScrollView&gt; &lt;/HorizontalScrollView&gt; </code></pre> <p>Add rows to <code>TLArchiveRowPlaceholder</code>.</p> <p>But in this case u need to have fixed widths of column. Or update header column widths after each main table update to not get headers misaligned.</p> <p>Hope this helps.</p> <p>My bad. Why answers were in comments? Didn't read them before =)</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.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      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