EditText 光标在 Android 4.0 或更低版本上可见,但在 Android 5.0 (Lollipop) 版本中不显示。我该如何解决这个问题?
最佳答案
在您的 XML 文件中添加 android:cursorVisible="true"
和 android:focusableInTouchMode="true"
。
例子:
<EditText
android:id="@+id/textLabel"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:cursorVisible="true"
android:focusableInTouchMode="true"/>
有时 EditText 需要焦点才能显示光标,所以也许它会对您有所帮助。
关于android - EditText 光标在 Android 5.0 (Lollipop) 上不可见,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/30374490/