When I use TextInputLayout (whose hintEnabled is false and style is OutLinedBox ), it seems to be clipped
See original GitHub issueWhen 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
it seems that the Input’s bound clipped
result I want
Issue Analytics
- State:
- Created 5 years ago
- Reactions:8
- Comments:11 (2 by maintainers)
Top 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 >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
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
Looking at the source code, the layout adds additional top margin if
hintEnabled
istrue
, 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.