Pralgomathic
Pralgomathic

Reputation: 108

EditText character hided on adding left and right margin in TableRow inside a TableLayout

In the layout bellow , if I write text on the editText field, then some character gets hided! What can be the reason? OR what would be the possible solution? Thanks in advance.

TableLayout
    android:id="@+id/loginInfoLayout"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:layout_below="@+id/errorMessageLayout"
    android:layout_marginLeft="@dimen/login_screen_left_right_margine"
    android:layout_marginRight="@dimen/login_screen_left_right_margine"
    android:layout_centerHorizontal="true"
    android:layout_marginTop="0dp" 
    android:paddingBottom="10dp"
    android:stretchColumns="1" >
    <TableRow
        android:id="@+id/emailInfoLayout"
        android:layout_width="match_parent"
        android:layout_height="wrap_content">
    <com.philips.uGrowSmartBabyMonitor.CustomTextView
        android:id="@+id/userEmailTextView"
        android:layout_width="wrap_content"
        android:layout_height="@dimen/login_field_row_height"
        android:text="@string/Email"
        style="@style/fieldLabel" />

    <com.philips.uGrowSmartBabyMonitor.CustomEdittext
        android:id="@+id/editTextEmail"
        android:layout_width="match_parent"
        android:layout_height="@dimen/login_field_row_height"
        style="@style/editText"
        android:layout_marginLeft="10dp"
        android:layout_marginStart="10dp"
        android:hint="@string/hint_email"
        android:inputType="textEmailAddress" />
    </TableRow>

Upvotes: 1

Views: 54

Answers (1)

Biswajit
Biswajit

Reputation: 1869

In tablerow always use weightSum it will arrange your views according to the screen. Try this :

<TableRow
    android:id="@+id/emailInfoLayout"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:weightSum="2">
<com.philips.uGrowSmartBabyMonitor.CustomTextView
    android:id="@+id/userEmailTextView"
    android:layout_width="odp"
    android:layout_weight="1"
    android:layout_height="@dimen/login_field_row_height"
    android:text="@string/Email"
    style="@style/fieldLabel" />

<com.philips.uGrowSmartBabyMonitor.CustomEdittext
    android:id="@+id/editTextEmail"
    android:layout_width="match_parent"
    android:layout_weight="1"
    android:layout_height="@dimen/login_field_row_height"
    style="@style/editText"
    android:layout_marginLeft="10dp"
    android:layout_marginStart="10dp"
    android:hint="@string/hint_email"
    android:inputType="textEmailAddress" />
</TableRow>

It will solve your problem.

Hope this helps you :)
Please let me know if you have any problem.

Upvotes: 2

Related Questions