I have an edit-text input in android 4.0 and the Cursor is not showing inside it.
What can make the cursor not appear in the input field?
I have an edit-text input in android 4.0 and the Cursor is not showing inside it.
What can make the cursor not appear in the input field?
I had a similar problem but it was because the cursor is actually white and I had a white background. I needed to be able to change the cursor to black in code somehow and used this approach.
I created a layout resource called textbox.axml which contained this
I then applied this layout in code (C# because I am using Xamarin) thus
but it is similar in Java.
I happened quite same problem - cursor was showing up only after user types some characters. I tried solutions listed here, but without any success on my device. What actually work for me, is setting blank text to my edittext:
This "fakes" the user input, and cursor appears.
Add this line for your edit text in the xml file.
Make
android:cursorVisible="true"
and
If you have used
android:textColor
then set theandroid:textCursorDrawable
attribute to@null
.Happy coding ;)