android - Expand button in TableRow -
i have @ bottom of screen 2 buttons next , previous inside table rows in table layout below.
<linearlayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent" android:layout_height="match_parent" tools:context="${relativepackage}.${activityclass}" > <scrollview android:layout_width="match_parent" android:layout_height="match_parent" android:background="#000000" > <tablelayout android:id="@+id/table1" android:layout_width="match_parent" android:layout_height="match_parent" android:layout_alignparentleft="true" android:layout_alignparenttop="true" android:background="#000000" > <tablerow android:background="#000000" android:id="@+id/tablerow1" android:layout_width="wrap_content" android:layout_height="wrap_content" > <textview android:textcolor="#ffffff" android:id="@+id/textview1" android:layout_width="wrap_content" android:layout_height="wrap_content" /> <textview /> </tablerow> <tablerow android:background="#000000" android:id="@+id/tablerow2" android:layout_width="wrap_content" android:layout_height="wrap_content" > <textview android:textcolor="#ffffff" android:id="@+id/textview2" android:layout_width="wrap_content" android:layout_height="wrap_content" /> </tablerow> <tablerow android:background="#000000" android:id="@+id/tablerow3" android:layout_width="wrap_content" android:layout_height="wrap_content" android:gravity="center" > <imageview android:id="@+id/imageview1" android:layout_width="wrap_content" android:layout_height="wrap_content" android:scaletype="fitcenter" android:adjustviewbounds="true" android:visibility="gone" /> <progressbar android:id="@+id/progressbar1" style="?android:attr/progressbarstylelarge" android:layout_width="fill_parent" android:layout_height="fill_parent" android:visibility="visible" /> </tablerow> <tablerow android:background="#000000" android:id="@+id/tablerow4" android:layout_width="wrap_content" android:layout_height="wrap_content" > <textview android:textcolor="#ffffff" android:id="@+id/textview3" android:layout_width="wrap_content" android:layout_height="wrap_content" /> </tablerow> <tablerow android:background="#000000" android:id="@+id/tablerow5" android:layout_width="wrap_content" android:layout_height="wrap_content" android:gravity="fill" > <button android:id="@+id/next" style="?android:attr/buttonstylesmall" android:layout_width="match_parent" android:layout_height="match_parent" android:onclick="gonext" android:text="next" /> </tablerow> <tablerow android:background="#000000" android:id="@+id/tablerow6" android:layout_width="wrap_content" android:layout_height="wrap_content" > <button android:id="@+id/previous" style="?android:attr/buttonstylesmall" android:layout_width="match_parent" android:layout_height="match_parent" android:onclick="goprevious" android:text="previous" /> </tablerow> </tablelayout> </scrollview> </linearlayout>
however, buttones next , previous don't fill row. want expand both buttons fill row (parent)? suggestions?
use layout_weight buttons
<linearlayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent" android:layout_height="match_parent" tools:context="${relativepackage}.${activityclass}" > <scrollview android:layout_width="match_parent" android:layout_height="match_parent" android:background="#000000" > <tablelayout android:id="@+id/table1" android:layout_width="match_parent" android:layout_height="match_parent" android:layout_alignparentleft="true" android:layout_alignparenttop="true" android:background="#000000" > <tablerow android:background="#000000" android:id="@+id/tablerow1" android:layout_width="wrap_content" android:layout_height="wrap_content" > <textview android:textcolor="#ffffff" android:id="@+id/textview1" android:layout_width="wrap_content" android:layout_height="wrap_content" /> <textview /> </tablerow> <tablerow android:background="#000000" android:id="@+id/tablerow2" android:layout_width="wrap_content" android:layout_height="wrap_content" > <textview android:textcolor="#ffffff" android:id="@+id/textview2" android:layout_width="wrap_content" android:layout_height="wrap_content" /> </tablerow> <tablerow android:background="#000000" android:id="@+id/tablerow3" android:layout_width="wrap_content" android:layout_height="wrap_content" android:gravity="center" > <imageview android:id="@+id/imageview1" android:layout_width="wrap_content" android:layout_height="wrap_content" android:scaletype="fitcenter" android:adjustviewbounds="true" android:visibility="gone" /> <progressbar android:id="@+id/progressbar1" style="?android:attr/progressbarstylelarge" android:layout_width="fill_parent" android:layout_height="fill_parent" android:visibility="visible" /> </tablerow> <tablerow android:background="#000000" android:id="@+id/tablerow4" android:layout_width="wrap_content" android:layout_height="wrap_content" > <textview android:textcolor="#ffffff" android:id="@+id/textview3" android:layout_width="wrap_content" android:layout_height="wrap_content" /> </tablerow> <tablerow android:background="#000000" android:id="@+id/tablerow5" android:layout_width="match_parent" android:layout_height="wrap_content" android:gravity="fill" > <button android:id="@+id/next" style="?android:attr/buttonstylesmall" android:layout_width="match_parent" android:layout_height="match_parent" android:onclick="gonext" android:layout_weight="1" android:text="next" /> </tablerow> <tablerow android:background="#000000" android:id="@+id/tablerow6" android:layout_width="match_parent" android:layout_height="wrap_content" > <button android:id="@+id/previous" style="?android:attr/buttonstylesmall" android:layout_width="match_parent" android:layout_height="match_parent" android:onclick="goprevious" android:layout_weight="1" android:text="previous" /> </tablerow> </tablelayout> </scrollview> </linearlayout>
i changed copy , paste work thanks
Comments
Post a Comment