Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

EditText: How to show cursor and hide underline at a time?

I'm developing an Calculator App. I wanna achieve the UI as like as Android default Calculator App. Please check my App's screenshot.

enter image description here

I want to hide the underline of EditText and show the cursor in white color. I used transparent background at EditText (from here) also used background as @null. It hides EditText's underline and also hide the cursor. BUT... for calculator App cursor should not be hidden.

Please give me a way to hide underline of EditText and show the EditText's cursor of white color.

like image 721
Hasan Abdullah Avatar asked Oct 17 '25 04:10

Hasan Abdullah


1 Answers

Set the background drawable as transparent and set the Text Cursor drawable of your choice. For Example:

<EditText
                android:id="@+id/remarkEditText"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:background="@android:color/transparent"
                android:textCursorDrawable="@drawable/white"/>
like image 146
Kishan Avatar answered Oct 18 '25 19:10

Kishan



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!