I have an EditText declared as below.
<EditText android:layout_margin="2dip" android:singleLine="true" android:lines="1" android:maxLines="1" android:cursorVisible="true" android:textCursorDrawable="@drawable/Black" android:textColor="@color/black" android:paddingLeft="5dp" android:paddingRight="5dp" android:background="@android:drawable/editbox_background" />
But its not not displaying the cursor, when getting focus. When I starts typing, its showing the cursor from 1st index. I want the cursor to be displayed even in empty edittext.
I have already tried setSelection(0)
but nothing happened. Please help me what should I do?
If you want your disabled EditText to look the same as your enabled one, you should use android:enabled="false" in combination with android:textColor="..." . Show activity on this post. Used this if you have an icon to be clickable, this works for me.
As mentioned above, here's the actual line
android:textCursorDrawable="@null"
fyi - @null didn't show up as an autocomplete option
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With