Как удалить поле по умолчанию для ConstraintLayout в составном представлении? - PullRequest
0 голосов
/ 17 июня 2020

Я создал настраиваемое составное представление, для которого на ConstraintLayout появляется отступ по умолчанию * Вот макет

<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout 
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_margin="0dp"
android:background="@color/red_wrong"
android:orientation="vertical"
android:padding="0dp">

<TextView
    android:id="@+id/tv_hint"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:fontFamily="@font/ubuntu"
    app:layout_constraintBottom_toTopOf="@id/et_input"
    app:layout_constraintStart_toStartOf="@id/et_input" />

<EditText
    android:id="@+id/et_input"
    android:layout_width="0dp"
    android:layout_height="@dimen/dimen50"
    android:layout_margin="0dp"
    android:background="@color/material_yellow50"
    android:fontFamily="@font/ubuntu"
    android:padding="0dp"
    app:layout_constraintBottom_toBottomOf="parent"
    app:layout_constraintEnd_toEndOf="parent"
    app:layout_constraintStart_toStartOf="parent"
    app:layout_constraintTop_toTopOf="parent" />

<ImageView
    android:id="@+id/iv_add_view"
    android:layout_width="@dimen/dimen20"
    android:layout_height="@dimen/dimen20"
    app:layout_constraintBottom_toTopOf="@id/et_input"
    app:layout_constraintEnd_toEndOf="@+id/et_input"
    app:srcCompat="@drawable/ic_add" />
 </androidx.constraintlayout.widget.ConstraintLayout>

enter image description here

Я также пробовал применить 0dp в качестве маржи. Мне нужно избавиться от этого нижнего поля.

Добро пожаловать на сайт PullRequest, где вы можете задавать вопросы и получать ответы от других членов сообщества.
...