How Android grid layout set component fill the specified row and column? -


code:

<gridlayout    xmlns:tools="http://schemas.android.com/tools"   xmlns:android="http://schemas.android.com/apk/res/android"   android:layout_width="match_parent"     android:layout_height="match_parent"      android:rowcount="6"     android:columncount="4" >    <!-- define textbox,across 4 columns -->  <textview     android:layout_width="match_parent"     android:layout_height="wrap_content"     android:layout_columnspan="4"     android:textsize="50sp"     android:layout_marginleft="4px"     android:layout_marginright="4px"     android:padding="5px"     android:layout_gravity="right"     android:background="#eee"     android:textcolor="#000"     android:text="test"     /> <!-- define 2 buttons,delete , reset -->  <button     android:id="@+id/bn1"     android:layout_columnspan="2"      android:layout_rowspan="1"     android:layout_gravity="fill"     android:text="clear"      />   <button     android:id="@+id/bn2"     android:layout_columnspan="2"      android:layout_rowspan="1"     android:layout_gravity="fill"          android:text="selete"     /> 

the above mail.xml code. results below:

enter image description here

how set 2 buttons half , half , fill line?

thanks in advance!

you want 2 bottom buttons fill width equally? put them in linearlayout layout_width=fill_parent , horizontal orientation. set each 1 have same layout_weight, , each 1 have width of 0dp. make them equal width.


Comments

Popular posts from this blog

c# - DetailsView in ASP.Net - How to add another column on the side/add a control in each row? -

javascript - firefox memory leak -

Trying to import CSV file to a SQL Server database using asp.net and c# - can't find what I'm missing -