android - How can I make my layout have TableRows of equal height? -


my layout this:

<scrollview         android:id="@+id/scrollview_page1"         android:layout_width="300dp"         android:layout_height="700dp" >          <linearlayout             android:layout_width="match_parent"             android:layout_height="wrap_content"             android:orientation="vertical" >               <tablerow                  android:layout_width="fill_parent"                  android:layout_height="60dip"                  android:gravity="right"                   >               <textview                 android:layout_width="wrap_content"                 android:layout_height="wrap_content"                 android:text="@string/string1"                 android:id="@+id/textview1"/>              <edittext                  android:id="@+id/edittext1"                  android:layout_width="wrap_content"                  android:layout_height="wrap_content"                  android:width="200dp"                  android:inputtype="number"/>              </tablerow>              <tablerow                 android:layout_width="fill_parent"                 android:layout_height="60dip"                 android:gravity="right"                  >               <textview                     android:layout_width="wrap_content"                     android:layout_height="wrap_content"                     android:text="@string/string2"                     android:id="@+id/textview2"/>               <spinner                     android:layout_width="wrap_content"                     android:layout_height="wrap_content"                     android:id="@+id/spinner1"                     android:width="200dp"                     />                 ......... 

the distance between tablerows seems not regular: of them close , of them far. don't want use android:paddingtop adjust them 1 one.

is there easy way make same distance between them? looks this:

picture of layout varying row heights

@giga_abhi spot on, add in each tablerow, need:

android:layout_height="0dip" 

and in linearlayout:

android:layout_height="fill_parent" 

and in scrollview:

android:fillviewport="true" 

Comments

Popular posts from this blog

javascript - Count length of each class -

What design pattern is this code in Javascript? -

hadoop - Restrict secondarynamenode to be installed and run on any other node in the cluster -