-5

enter image description here

How can we achieve this things in android?

InputText of EditText on Border?

Gabriele Mariotti
  • 320,139
  • 94
  • 887
  • 841
Prashant Arvind
  • 2,139
  • 20
  • 27
  • 1
    This can be achieved using material library provided by google. Find more details on this link - https://material.io/design/components/text-fields.html#outlined-text-field – Rajnish suryavanshi Aug 21 '19 at 12:38
  • 1
    Simply apply outlined box style to _TextInputLayout_ by `style="@style/Widget.MaterialComponents.TextInputLayout.OutlinedBox"` – Piyush Aug 21 '19 at 12:49

1 Answers1

1

Use the TextInputLayout

<com.google.android.material.textfield.TextInputLayout
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:hint="@string/hint_text">

  <com.google.android.material.textfield.TextInputEditText
      android:layout_width="match_parent"
      android:layout_height="wrap_content"/>

</com.google.android.material.textfield.TextInputLayout>

And apply this style:

style="@style/Widget.MaterialComponents.TextInputLayout.OutlinedBox"

enter image description here

Gabriele Mariotti
  • 320,139
  • 94
  • 887
  • 841