Textfield with initial value in Constraintlayout

Asked

Viewed 25 times

1

I am unable to identify the error in the XML specification, with each character added at the Textfield startup, which is inside the Constraintlayout, the root Linearlayout increases the height.

In advance thank you.

inserir a descrição da imagem aqui

The layout with red background, which contains the Title and Contraintlayout, is as follows::

<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
              xmlns:app="http://schemas.android.com/apk/res-auto"
              android:orientation="vertical"
              android:layout_width="match_parent"
              android:layout_height="wrap_content"
    android:background="@color/r500">

The internal is this

<include layout="@layout/main_dialog_title"/>

<android.support.constraint.ConstraintLayout
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:paddingLeft="@dimen/layout_margin10"
    android:paddingTop="@dimen/layout_margin20"
    android:paddingRight="@dimen/layout_margin10"
    android:background="@color/g500">

    <TextView
        style="@style/label"
        android:id="@+id/labCod"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        app:layout_constraintLeft_toLeftOf="parent"
        app:layout_constraintTop_toTopOf="parent"
        android:text="@string/codigo"/>

    <lib.client.control.CTextField
        style="@style/textField"
        android:id="@+id/txfCod"
        android:layout_width="0dp"
        android:layout_height="wrap_content"
        app:layout_constraintWidth_percent="0.3"
        app:layout_constraintLeft_toLeftOf="parent"
        app:layout_constraintTop_toBottomOf="@+id/labCod"

        android:text="AAA_A"/>

    <TextView
        style="@style/label"
        android:id="@+id/labNom"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_marginTop="@dimen/layout_margin10"
        app:layout_constraintLeft_toLeftOf="parent"
        app:layout_constraintTop_toBottomOf="@+id/txfCod"
        android:text="@string/nome"/>

    <lib.client.control.CTextField
        style="@style/textField"

        android:id="@+id/txfNom"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        app:layout_constraintLeft_toLeftOf="parent"
        app:layout_constraintTop_toBottomOf="@+id/labNom"/>

    <lib.client.control.CLabelCount
        style="@style/labelCount"
        android:id="@+id/labCnt"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        app:layout_constraintTop_toTopOf="@+id/txfNom"
        app:layout_constraintRight_toRightOf="@+id/txfNom"
        app:layout_constraintBottom_toBottomOf="@+id/txfNom"/>

    <Button
        style="?android:attr/buttonBarButtonStyle"
        android:id="@+id/btnOkk"

        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_marginTop="@dimen/layout_margin10"
        app:layout_constraintTop_toBottomOf="@+id/txfNom"
        app:layout_constraintRight_toRightOf="parent"/>

</android.support.constraint.ConstraintLayout>

No answers

Browser other questions tagged

You are not signed in. Login or sign up in order to post.