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.

[TextInputEditText] Vertically cut off

See original GitHub issue

Description: TextInputEditText are getting vertically cut off Screenshot 2020-03-23 at 13 31 55

Expected behavior: Not getting cut off, just downgrade to 1.1.0 and it works. Screenshot 2020-03-23 at 13 23 01

Source code:

<com.google.android.material.textfield.TextInputEditText
                   style="@style/App.EditTextStyle"
                   android:layout_width="0dp"
                   android:layout_height="50dp"
                   android:layout_marginStart="7dp"
                   android:layout_marginTop="78dp"
                   android:layout_marginEnd="17dp"
                   android:background="@android:color/transparent"
                   android:digits="0123456789 "
                   android:hint="@string/hint_insert_phone"
                   android:imeOptions="actionDone"
                   android:inputType="number|phone"
                   android:text="@={viewModel.phoneNumber}"
                   android:fontFamily="@font/open_sans"
                   app:layout_constraintEnd_toEndOf="parent"
                   app:layout_constraintStart_toEndOf="@+id/tv_phone_input_label"
                   app:layout_constraintTop_toBottomOf="@+id/const_title" />
    <style name="App.EditTextStyle" parent="Widget.MaterialComponents.TextInputLayout.FilledBox">
        <item name="android:fontFamily">@font/open_sans_semibold</item>
        <item name="android:textSize">16sp</item>
        <item name="android:maxLines">1</item>
        <item name="android:singleLine">true</item>
        <item name="android:backgroundTint">@android:color/transparent</item>
        <item name="android:textColorHint">?android:attr/textColorSecondary</item>
    </style>

Android API version: API 29

Material Library version: 1.2.0-alpha05

Device: Pixel 3a

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:5 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
leticiarossicommented, Mar 23, 2020

Are you using a TextInputEditText without a surrounding TextInputLayout? I see your custom style extends from a TextInputLayout style instead of the Widget.MaterialComponents.TextInputEditText.FilledBox style. I don’t know if that could be the cause of the issue, but it’s worth a try.

0reactions
leticiarossicommented, Mar 24, 2020

yes, that’s the expected approach!

Read more comments on GitHub >

github_iconTop Results From Across the Web

TextInputEditText top of text input cut off android - Stack Overflow
I have Text Field with some styles applyed to change the background aspect. For some reason the input text when writing is cut...
Read more >
Android TextInputLayout Example | DigitalOcean
The primary use of a TextInputLayout is to act as a wrapper for EditText(or its descendant) and enable floating hint animations. Rule of...
Read more >
Working with the EditText | CodePath Android Cliffnotes
The EditText is the standard text entry widget in Android apps. If the user needs to enter text into an app, this is...
Read more >
Why My Textinputlayout Always Cuts Off Upper Hint Text In ...
Description: TextInputEditText are getting vertically cut off Expected behavior: Not getting cut off just downgrade to 1.1.0 and it works. Introduction In this ......
Read more >
Autosizing TextViews - Android Developers
Default setting lets the autosizing of TextView scale uniformly on horizontal and vertical axes. ... Note: The default dimensions for uniform ...
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