android - Help create TableLayout inside .java activity -


i having problem create tablelayout inside activity. far managed display resulting query using textview.

( (textview) view.findviewbyid(r.id.tv_id) ).settext( listitem.getid()+"");  ( (textview) view.findviewbyid(r.id.tv_name) ).settext( listitem.getname() );  ( (textview) view.findviewbyid(r.id.tv_age) ).settext( listitem.getage()+"" ); 

i appreciate if can me turn textview tablelayout.

thanks help

you need in layout xml. if output of activity xml like:

<table_layout android:layout_width="fill_parent" android:layout_height="fill_parent" android:stretch_columns="*">  <tablerow> <textview android:id="@+/tv_id" android:layout_width="wrap_content" android:layout_height="fill_parent"/> <textview android:id="@+/tv_name" android:layout_width="wrap_content" android:layout_height="fill_parent"/> <textview android:id="@+/tv_age" android:layout_width="wrap_content" android:layout_height="fill_parent"/> </tablerow>  </table_layout> 

if there more rows wrap in scrollview ui scrollable.


Comments

Popular posts from this blog

android - Spacing between the stars of a rating bar? -

html - Instapaper-like algorithm -

c# - How to execute a particular part of code asynchronously in a class -