Подтвердить что ты не робот

EditText - разрыв между текстом и строкой EditText

Когда я вставляю текст в поле EditText, текст имеет ненормальный разрыв между собой и строкой EditText. Здесь есть печатный экран с моего терминала, где вы видите этот пробел, о котором я говорю, он отмечен красным. enter image description here

Я играл с выравниванием текста и гравитацией, но без успеха.

Здесь XML:

<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
                xmlns:tools="http://schemas.android.com/tools"
                android:layout_width="match_parent"
                android:layout_height="match_parent"
                android:paddingBottom="@dimen/activity_vertical_margin"
                android:paddingLeft="@dimen/activity_horizontal_margin"
                android:paddingRight="@dimen/activity_horizontal_margin"
                android:paddingTop="@dimen/activity_vertical_margin"
                tools:context=".MainActivity">

    <TableLayout
        android:id="@+id/startJourneyLinearLayout"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:stretchColumns="1">

        <TableRow
            android:layout_width="fill_parent"
            android:layout_height="fill_parent">

            <TextView
                android:id="@+id/startLocationTxtView"
                android:layout_width="wrap_content"
                android:layout_height="match_parent"
                android:layout_column="0"
                android:layout_gravity="start"
                android:text="@string/startLocation"
                android:gravity="center"
                android:textAppearance="?android:attr/textAppearanceLarge"/>

            <EditText
                android:id="@+id/startLocation"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:layout_column="1"
                android:gravity = "bottom"
                android:hint="Some text"
                android:inputType="text"/>

            <ImageView
                android:layout_width="wrap_content"
                android:layout_height="match_parent"
                android:layout_column="2"
                android:src="@drawable/my_ic_location"/>
        </TableRow>

        <TableRow
            android:layout_width="fill_parent"
            android:layout_height="fill_parent">

            <TextView
                android:id="@+id/endLocationTxtView"
                android:layout_width="wrap_content"
                android:layout_height="match_parent"
                android:layout_column="0"
                android:layout_gravity="start"
                android:gravity="center"
                android:text="@string/endLocation"
                android:textAppearance="?android:attr/textAppearanceLarge"/>

            <EditText
                android:id="@+id/endLocation"
                android:layout_width="match_parent"
                android:layout_height="match_parent"
                android:layout_column="1"
                android:inputType="text"/>
        </TableRow>

        <Button
            android:id="@+id/goButton"
            android:layout_width="wrap_content"
            android:layout_height="match_parent"
            android:layout_gravity="center"
            android:text="@string/go"/>

    </TableLayout>

</RelativeLayout>

Может ли кто-нибудь понять, почему это происходит, и объяснить мне, как я могу это исправить?

--------------- EDIT -----------------------

Я обновил XML-код, который я разместил в исходном вопросе, до реального кода XML, который у меня есть на моем приложении, как это запрошено в комментарии.

Первый печатный экран (тот, что выше, находится с реального устройства → Galaxy S4, работающий под управлением Android 4.4.4 CyanogenMod), и вот экран из эмулятора с использованием API 19

enter image description here

4b9b3361

Ответ 1

Чтобы изменить разрыв между текстом EditText и нижней строкой, вы можете использовать android:paddingBottom

  <EditText
      android:id="@+id/nameEditText"
      style="@style/DarkEditText"
      android:layout_width="match_parent"
      android:layout_height="wrap_content"
      android:hint="@string/name"
      android:paddingBottom="20dp"/>

Замените paddingBottom значение согласно вашему требованию.

Ответ 2

Попробуйте

android:layout_height="wrap_content"

вместо

android:layout_height="match_parent" в вашем EditText.

Ответ 3

<EditText
   android:id="@+id/editTxt1"
   android:layout_width="match_parent"
   android:layout_height="wrap_content"
   android:layout_column="1"
   android:layout_gravity = "bottom"
   android:hint="Some text"
   android:inputType="text"/>