question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Textinputlayout messing up when setting an height

See original GitHub issue
<com.google.android.material.textfield.TextInputLayout
            android:layout_width="match_parent"
            android:layout_height="0dp"
            android:id="@+id/username"
            app:layout_constraintTop_toTopOf="parent"
            app:layout_constraintStart_toStartOf="parent"
            app:layout_constraintBottom_toTopOf="@+id/password"
            app:layout_constraintVertical_chainStyle="spread_inside"
            app:layout_constraintHeight_default="percent"
            app:layout_constraintHeight_percent="0.2"
            android:hint="ggggggggggggggggg"
            android:background="@color/primaryColor"
            app:boxStrokeColor="@color/secondaryDarkColor"
            app:boxStrokeWidth="10px">
            <com.google.android.material.textfield.TextInputEditText
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                />
        </com.google.android.material.textfield.TextInputLayout>

This is part of a constrained layout, and I have the same issue even if I set the height of Textinputedittext to match_parent; the result is this

If I let the Textinputlayout’s height being wrap_content it works without problems, so I think that it has an issue while scaling, and it doesn’t do it properly

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Reactions:9
  • Comments:8 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
drchencommented, Apr 25, 2022

Hi @VitKap, thanks for the info.

Unfortunately I guess it’s very difficult for us to keep a complex UX working perfectly when there are too limited spaces for it… It’s not ideal but I would say it’s kind of working as intended…

0reactions
VitKapcommented, Apr 25, 2022

When you need to make the TextInputLayout smaller than 56dp for some reason there is not an easy way to do it. So it is still hapenning but I don’t know if this is a bug or a definition by specs.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Android TextInputLayout writing focus issue when height is ...
This TextInputLayout's height is dynamic, as in, the height will grow when more text is being written. So in a case where the...
Read more >
TextInputLayout Styling - Medium
Styling of each element of the TextInputLayout. Change the EditText bubble color. Change default outline border color for TextInputLayout.
Read more >
TextInputLayout | Android Developers
Returns the placeholder text that was set to be displayed with setPlaceholderText(CharSequence) , or null if there is no placeholder text. int ...
Read more >
Android TextInputLayout Using Kotlin With Example
We use android:layout_height=”” attribute to set height of TextInputLayout. We can do it as below –. <TextInputLayout. android ...
Read more >
TextInputLayout setError() will not show an error after it is ...
When setError("some text here") is called on a TextInputLayout for the first time, the error is shown properly. If the error is cleared...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found