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.

When I use TextInputLayout (whose hintEnabled is false and style is OutLinedBox ), it seems to be clipped

See original GitHub issue

When I use TextInputLayout (whose hintEnabled is false and style is OutLinedBox ), it seems to be clipped

Requirement

I want TextInputLayout’s height is same as When it’s hintEnabled is true, but don’t show the lable(hint) on TextInputLayout, and the hint be shown in EditText

code in xml

<android.support.design.widget.TextInputLayout
        style="@style/Widget.MaterialComponents.TextInputLayout.OutlinedBox"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        app:hintEnabled="false"
        >
        <android.support.design.widget.TextInputEditText
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:hint="12312312312"
            />
    </android.support.design.widget.TextInputLayout>

result

2018-07-31 8 47 44

it seems that the Input’s bound clipped

result I want

2018-07-31 8 49 32

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Reactions:8
  • Comments:11 (2 by maintainers)

github_iconTop GitHub Comments

9reactions
AtulSalgaonkarcommented, May 4, 2020

if you have used app:hintEnabled=“false” then also set android:paddingTop=“8dp” in EditText and boom top hint space is gone, this worked for me hope this works for you too

6reactions
nasahappscommented, Sep 5, 2018

Looking at the source code, the layout adds additional top margin if hintEnabled is true, else it completely ignores adding any top margin.

Don’t know why they coded it like that, the top edge of the view is still there regardless if the hint is enabled or not. If that method (and the methods that call that method) weren’t private, it’d be a simple fix to just ignore checking if hintEnabled is true or not, but those methods being private complicates things for us end-users.

Read more comments on GitHub >

github_iconTop Results From Across the Web

android - TextinputLayout does not display the style correctly if ...
The input should be frame so set style. But I need to disable hint animation, I set app:hintEnabled="false" animation work correct, ...
Read more >
TextInputLayout Styling - Medium
xml should be used to customize labels, helpers and errors in TextInputLayout. The parent of the text appearance style should be TextAppearance.
Read more >
While Using A Material.Textfield.Textinputlayout, My Outlined ...
MaterialComponents.TextInputLayout.OutlinedBox. When I use TextInputLayout whose hintEnabled is false and style is OutLinedBox it seems to be clipped #180.
Read more >
TextInputLayout | Android Developers
Returns the text color used by the hint in both the collapsed and expanded states, or null if no color has been set....
Read more >
Text fields - Material Design
If you are using a custom EditText as TextInputLayout's child and your text ... Note: The filled text field is the default style...
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