Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to increase the height of table row according to screens?

I would like to know how can I increase the height of table row so it looks proportionate in larger screen sizes. Currently all of the textviews and edittexts(placed in table rows) appear on the left side of the screen instead of occuping the whole screen( only in larger screen sizes). Here is the xml I am working with:

<ScrollView android:id="@+id/ScrollView01" 
  android:layout_width="fill_parent" 
  android:layout_height="fill_parent" 
  xmlns:android="http://schemas.android.com/apk/res/android">     

<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:orientation="vertical"
    android:layout_width="fill_parent"

    android:layout_height="fill_parent" android:background="@color/black_background">

<TableLayout 
    xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_height="fill_parent" 
    android:layout_width="fill_parent"
    >
  <TableRow    android:id="@+id/TableRow01" 
               android:layout_width="fill_parent" 
               android:layout_height="wrap_content" >


  <TextView  android:id="@+id/name"
             android:layout_width="wrap_content"
             android:layout_height="wrap_content"
             android:textSize="20sp"
             android:textColor="@color/white" 
             android:visibility="visible" 
             android:text="@string/Name" 
             android:layout_weight="0.2"
             android:layout_marginLeft="20dp" 
             android:layout_marginTop="22dp"/>

 <EditText   android:id="@+id/myName"
             android:layout_width="120dip"
             android:layout_height="wrap_content"
             android:textSize="20sp"
             android:visibility="visible" 
             android:layout_weight="0.3"
             android:inputType="number" 
             android:textColor="@color/black_background" 
             android:layout_marginLeft="10dp" 
             android:layout_marginTop="10dp"/>

 <TextView   android:id="@+id/error1"
              android:layout_width="wrap_content"
             android:layout_height="wrap_content"
             android:textSize="18sp"
             android:textColor="@color/red" 
             android:visibility="visible" 
             android:layout_weight="0.5"/>

  </TableRow>
 <TableRow    android:id="@+id/TableRow02" 
               android:layout_width="fill_parent" 
              android:layout_height="wrap_content">


  <TextView  android:id="@+id/address"
             android:layout_width="wrap_content"
             android:layout_height="wrap_content"
             android:textSize="20sp"
             android:visibility="visible"
             android:textColor="@color/white" 
             android:text="@string/address" 
             android:layout_weight="0.2"
             android:layout_marginLeft="20dp" android:layout_marginTop="22dp"/>

 <EditText   android:id="@+id/address"
             android:layout_width="120dip"
             android:layout_height="wrap_content"
             android:textSize="20sp"
             android:visibility="visible" 
             android:inputType="number" 
             android:textColor="@color/black_background" 
             android:layout_weight="0.8"
             android:layout_marginLeft="10dp" android:layout_marginTop="10dp"/>

  </TableRow>
</TableLayout>           

    </LinearLayout>
 </ScrollView> 
like image 656
artist Avatar asked Apr 23 '11 13:04

artist


People also ask

How do I increase the height of a row in a table?

Change row height To set the row height to a specific measurement, click a cell in the row that you want to resize. On the Layout tab, in the Cell Size group, click in the Table Row Height box, and then specify the height you want. To use the ruler, select a cell in the table, and then drag the markers on the ruler.

How do I automatically adjust row height in Excel?

Select the row or rows that you want to change. On the Home tab, in the Cells group, click Format. Under Cell Size, click AutoFit Row Height. Tip: To quickly autofit all rows on the worksheet, click the Select All button, and then double-click the boundary below one of the row headings.

How do I change row height in CSS?

So, here we put “tr” which is used for the rows and set the height of the row by utilizing the CSS “line-height” property. We are setting “30px” for the height of the table's row. This height will apply to all rows of the table.

How do you resize the height of a row in a table in Powerpoint?

Position the mouse pointer on the border below the row you want to resize. Changing the height of rows will change the overall size of the table. Rest the pointer over the row boundary you want to change. Hold down the mouse and drag the row to a new height.


1 Answers

Use

android:minHeight="60px"

On TableRow tag

<TableRow android:id="@+id/task1" android:layout_width="fill_parent"
          android:minHeight="60px" android:layout_height="wrap_content">
like image 163
Mike Avatar answered Sep 18 '22 05:09

Mike