android - Divide a Screen Into Equally With Two TextView -


in android layout have 2 textview. each in different table row. want divide these row equally. first textview gcm based text , second harcoded. row should divided equally not depending on size of text have put scrollview , need it.

<tablelayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" android:id="@+id/tablelayout1" android:layout_width="match_parent" android:layout_height="match_parent" android:stretchcolumns="*" android:background="@drawable/border" android:paddingbottom="@dimen/activity_vertical_margin" android:paddingleft="@dimen/activity_horizontal_margin" android:paddingright="@dimen/activity_horizontal_margin" android:paddingtop="@dimen/activity_vertical_margin" tools:context=".livemsg" >   <tablerow     android:id="@+id/tablerow1"    android:layout_height = "100dp"     android:layout_weight = "1"     android:paddingbottom="20dip"     android:gravity="center" >   <scrollview     android:layout_width="wrap_content"     android:layout_height="wrap_content"     android:layout_weight="0.97"     android:id="@+id/scrollview1"     android:scrollbars="vertical" >  <textview     android:id="@+id/lblmessage"     android:layout_width="fill_parent"     android:layout_height="wrap_content"     android:textcolor="#ffffff"     android:textsize="30sp"     android:text="" /> </scrollview> </tablerow>  <tablerow     android:id="@+id/tablerow2"    android:layout_height = "100dp"     android:layout_weight = "1"     android:paddingbottom="20dip"     android:gravity="center"  >   <scrollview     android:layout_width="wrap_content"     android:layout_height="wrap_content"     android:layout_weight="0.97"     android:id="@+id/scrollview2"     android:scrollbars="vertical" >  <textview     android:id="@+id/tablerow5"     android:layout_width="fill_parent"     android:layout_height="wrap_content"     android:textcolor="#ffff00"     android:textsize="20sp"     android:text="long text goes here....long text goes here....long text goes here....long text goes here....long text goes here....long text goes here....long text goes here....long text goes here....long text goes here....long text goes here....long text goes here....long text goes here....long text goes here....long text goes here....long text goes here....long text goes here....long text goes here....long text goes here....long text goes here....long text goes here....long text goes here....long text goes here....long text goes here....long text goes here.... " /> </scrollview> </tablerow> 

it should work on screen size.how can that?

replace tablerow this:

<tablerow   android:id="@+id/tablerow2"   android:layout_width = "match_parent"   android:layout_height = "match_parent"   android:layout_weight = "1"   android:paddingbottom="20dip"   android:gravity="center"> 

also remove weights scroll view. can use 2 scroll views same trick above.


Comments

Popular posts from this blog

javascript - Google App Script ContentService downloadAsFile not working -

javascript - Function overwritting -

php - Find a regex to take part of Email -