Jeongbebs
Jeongbebs

Reputation: 4120

TextInputLayout border gets chopped when it gets refocused and has text

I have started to introduce material design on an existing project. I have a TextInputLayout, however, when it gets refocused and it has text, the border gets chopped. See image

enter image description here

Any ideas what attribute should be changed on either TextInputLayout or Edittext? Thanks

Upvotes: 1

Views: 260

Answers (2)

Vikasdeep Singh
Vikasdeep Singh

Reputation: 21766

Currently your cursor ballon (bottom) color is white due to which it looks like border cutout so you can either change the color or remove the ballon.

Below attribute can be modified:

<style name="ThemeOverlay.AppTheme.TextInputEditText.Outlined" parent="">
    <item name="colorControlActivated">@color/...</item>

Regarding the primaryColor attribute, you can change the primaryColor of your app here:

<style name="AppTheme" parent="Theme.MaterialComponents.DayNight">
    <item name="colorPrimary">@color/colorPrimary</item>

Upvotes: 1

Thomas Meinhart
Thomas Meinhart

Reputation: 689

This is because the cursor marker (don't know the correct name for that thing) is white in your case. I think this color is the accentColor of your app per default.

As documented here https://material.io/components/text-fields/android#outlined-text-field the default color is ?attr/primaryColor

enter image description here

Upvotes: 1

Related Questions