在 TableLayout 中的 TableRow 中添加左右边距时隐藏的 EditText 字符

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

在下面的布局中,如果我在 editText 字段上写入文本,那么某些字符会被隐藏!可能是什么原因?或者可能的解决方案是什么?提前致谢。

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>

在 tablerow 中总是使用 weightSum 它会根据屏幕排列你的视图。 试试这个:

<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>

它将解决您的问题。

希望对您有所帮助:)
如果您有任何问题,请告诉我。