0

Как изменить стиль EditText? Первая каритнка - то что есть сейчас, вторая - то, что мне нужно (цвет не имеет значения).

dialog_input.xml

<?xml version="1.0" encoding="utf-8"?>
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:tools="http://schemas.android.com/tools"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:paddingLeft="16dp"
    android:paddingRight="16dp"
    android:paddingBottom="4dp"
    android:paddingTop="16dp">

    <com.google.android.material.textfield.TextInputLayout
        android:id="@+id/md_input_layout"
        android:layout_width="match_parent"
        android:layout_height="wrap_content">

        <EditText
            android:id="@+id/subj_name_input_edit_text"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            tools:text="Hello, World!"
            android:hint="@string/subject_name_dialog_hint"
            android:inputType="text"
            android:maxLines="1"
            android:maxLength="32" />
    </com.google.android.material.textfield.TextInputLayout>
</FrameLayout>

введите сюда описание изображения

1 ответ 1

1

Для EditText уберите отступ при старте (paddingStart), уменьшите отступ снизу (paddingBottom12dp по умолч. - отступ) и фон прозрачный нужно сделать (или белый).

<EditText
    android:background="@android:color/transparent"
    android:paddingStart="0dp"
    android:paddingBottom="4dp"
    ....

Еще мне кажется что увеличен отступ сверху, нужно измерить и выставить (28dp по умолч. + отступ)

android:paddingTop="34dp"

Ваш ответ

By clicking “Отправить ответ”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Всё ещё ищете ответ? Посмотрите другие вопросы с метками или задайте свой вопрос.