android - TableLayout with Top and Left header With Horizontal and Vertical Scroll -


i want create tablelayout in android studio horizontal , vertical scroll.

also, want fixed header on top , left.

i created table scrollview , horizontalscrollview.

since there many columns not fit screen , header need's scrollable.

i searched approaches solving found solution without scrollable header.

i cannot use scrollview inside because scrollview contains 1 element , in case, 1 element must tablelayout , when used created 2 separate table , both table not in sync (only second table scrollable).

<scrollview     android:id="@+id/layout"     android:layout_width="match_parent"     android:layout_height="match_parent"     android:layout_margintop="5dip"     android:fillviewport="true"     android:scrollbarstyle="outsideinset"     android:scrollbars="horizontal|vertical">      <horizontalscrollview         android:id="@+id/horizontalview"         android:layout_width="wrap_content"         android:layout_height="wrap_content"         android:layout_margintop="5dip"         android:scrollbars="horizontal|vertical">          <tablelayout             android:id="@+id/scheduletable"             android:layout_width="match_parent"             android:layout_height="match_parent">              <tablerow>                  <textview                     android:layout_width="match_parent"                     android:layout_height="match_parent"                     android:layout_margin="1dp"                     android:background="@color/coloraccent"                     android:padding="4dp"                     android:text="venue" />                  <textview                     android:layout_width="match_parent"                     android:layout_height="match_parent"                     android:layout_margin="1dp"                     android:background="@color/colorprimary"                     android:padding="4dp"                     android:text="9 10 am"                     android:textcolor="@color/white" />                  <textview                     android:layout_width="wrap_content"                     android:layout_height="wrap_content"                     android:layout_margin="1dp"                     android:background="@color/colorprimary"                     android:padding="4dp"                     android:text="10 11 am"                     android:textcolor="@color/white" />                  <textview                     android:layout_width="wrap_content"                     android:layout_height="wrap_content"                     android:layout_margin="1dp"                     android:background="@color/colorprimary"                     android:padding="4dp"                     android:text="12 1 pm"                     android:textcolor="@color/white" />                  <textview                     android:layout_width="wrap_content"                     android:layout_height="wrap_content"                     android:layout_margin="1dp"                     android:background="@color/colorprimary"                     android:padding="4dp"                     android:text="1 pm 2 pm"                     android:textcolor="@color/white" />                  <textview                     android:layout_width="wrap_content"                     android:layout_height="wrap_content"                     android:layout_margin="1dp"                     android:background="@color/colorprimary"                     android:padding="4dp"                     android:text="2 pm 3 pm"                     android:textcolor="@color/white" />                  <textview                     android:layout_width="wrap_content"                     android:layout_height="wrap_content"                     android:layout_margin="1dp"                     android:background="@color/colorprimary"                     android:padding="4dp"                     android:text="3 pm 4 pm"                     android:textcolor="@color/white" />                  <textview                     android:layout_width="wrap_content"                     android:layout_height="wrap_content"                     android:layout_margin="1dp"                     android:background="@color/colorprimary"                     android:padding="4dp"                     android:text="4 pm 5 pm"                     android:textcolor="@color/white" />             </tablerow>              <tablerow>                  <textview                     android:layout_width="match_parent"                     android:layout_height="match_parent"                     android:background="@color/coloraccent"                     android:text="place 1" />                  <include                     layout="@layout/item_schedule_event"                     android:layout_width="match_parent"                     android:layout_height="match_parent"                     android:layout_column="2"                     android:layout_span="2" />             </tablerow>              <tablerow>                  <textview                     android:layout_width="match_parent"                     android:layout_height="match_parent"                     android:background="@color/coloraccent"                     android:text="place 2" />                  <include                     layout="@layout/item_schedule_event"                     android:layout_width="match_parent"                     android:layout_height="match_parent"                     android:layout_column="1"                     android:layout_span="2" />             </tablerow>          </tablelayout>     </horizontalscrollview> </scrollview> 


Comments

Popular posts from this blog

What is happening when Matlab is starting a "parallel pool"? -

angular - DownloadURL return null in below code -

php - Cannot override Laravel Spark authentication with own implementation -