Scale table layout according to screen orientation

0

I'm kind of lost in the assembly of my screens on Android, I'm not able to make the elements fit the dimensions of the screen. I put fill_parent in tablerows and elements inside it, but editTexts do not scale and they look like wrap_content , and when I turn the screen horizontally the layout occupy only part of the screen.

On the vertical screen I put values in width and it was nice but not automatic.

How do I make my layout fill the entire screen automatically?

The canvas vertically:

Thescreenishorizontal:

The layout code:

<TableLayout
    android:layout_width="fill_parent"
    android:layout_height="wrap_content">

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

    <TextView 
        android:background="@drawable/borda"
        android:padding="5dp"
        android:textAppearance="?android:attr/textAppearanceMedium"
        android:layout_width="fill_parent"
        android:layout_height="wrap_content"
        android:text="Atendimento:"/>

    <EditText
        android:background="@drawable/borda"
        android:padding="5dp"
        android:textAppearance="?android:attr/textAppearanceMedium"
        android:id="@+id/edtAtendimento"
        android:layout_width="155dp"
        android:layout_height="wrap_content"/>

    <TextView 
        android:background="@drawable/borda"
        android:padding="5dp"
        android:textAppearance="?android:attr/textAppearanceMedium"
        android:layout_width="fill_parent"
        android:layout_height="wrap_content"
        android:text="Data/hora:"/>

    <EditText
        android:background="@drawable/borda"
        android:padding="5dp"
        android:textAppearance="?android:attr/textAppearanceMedium"
        android:id="@+id/edtDataHora"
        android:layout_width="160dp"
        android:layout_height="wrap_content"/>

</TableRow>
    
asked by anonymous 28.05.2014 / 03:38

1 answer

1

I think to do this, you will need a much more complex configuration, try putting this in your EditText android:layout_weight="1" .

    
28.05.2014 / 05:02