0
I’m a little lost in mounting my screens on Android, I’m not able to make the elements fit the screen dimensions. I put fill_parent
in the tablerows
and in the elements within it, but the editTexts
they don’t size up and feel like they’re in wrap_content
, and when I turn the screen to horizontal the layout occupies only a part of the screen.
On the vertical screen I put values on width
and it was cool but not automatic.
How to make my layout occupy the entire screen automatically?
The canvas in vertical:
The canvas in the horizontal:
The code of the layout:
<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>
First suggestion: exchange fill_parent for match_parent. fill_parent this deprecated. If it doesn’t work, I have another suggestion, but it involves a drastic layout modification.
– Wakim