I have a screen that has textviews and edittexts.
I am trying to edittexts equal width. But they look very small width. I dont want to give a dip value. How can I do?
Thanks a lot.
<TableLayout
android:id="@+id/TableLayout"
android:layout_height="wrap_content"
android:layout_width="fill_parent"
android:layout_centerHorizontal="true"
>
<TableRow>
<TextView
android:layout_height="wrap_content"
android:layout_width="wrap_content"
android:text="Name"
>
</TextView>
<EditText
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="@+id/name">
</EditText>
</TableRow>
<TableRow>
<TextView
android:layout_height="wrap_content"
android:layout_width="wrap_content"
android:text="Last Name"
>
</TextView>
<EditText
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="@+id/lastname">
</EditText>
</TableRow>
</TableLayout>
Why not wrap the following code in a Linearlayout, and add an attribute android:layout_weight=1 to both the TextView and EditText. This will help you to provide both of them of the same width!!
Let me know if you have any queries