-5

enter image description here

How can we achieve this things in android?

InputText of EditText on Border?

Gabriele Mariotti
  • 250,295
  • 77
  • 670
  • 690
Prashant Arvind
  • 1,751
  • 17
  • 22
  • 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
  • 250,295
  • 77
  • 670
  • 690