EditText cursor is invisible in Android 4.0

前端 未结 11 1247
逝去的感伤
逝去的感伤 2020-12-14 09:16

I have an EditText input in Android 4.0 and the Cursor is not showing inside it.

What can make the cursor not appear in the input field?

11条回答
  •  悲&欢浪女
    2020-12-14 09:46

    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

        EditText txtCompletionDate = (EditText)LayoutInflater.Inflate(Resource.Layout.textbox, null);
    

    but it is similar in Java.

提交回复
热议问题