Android EditText:希望光标总是在用户进行一些有效输入之前显示出来吗
我正在做我的第一个android应用程序,我有一个编辑文本区域,我需要光标始终显示在其中。这里的“总是显示”意味着即使用户第一次点击编辑文本,光标也应该显示,而不是在用户真正输入内容后才显示 为了清楚起见,请参考第一张图片,当我第一次点击edittext区域时,您可以看到,只有softInputMethod显示,但edittext没有光标: 请参考第二张图片,你可以发现只要我输入了有效的信息,光标就会显示: 那么,有谁能告诉我如何使光标始终显示,甚至在我真正进行一些有效输入(使光标显示在第一张图片中)之前 作为参考,我已经尝试使用android:cursorVisible=“true”、android:focusable=“true”和android:focusableInTouchMode=“true”以及其他一些方法来实现这一点。但这些都不能真正解决这个问题。所以我真的需要一些其他的建议 非常感谢 p.S以下是我的此edittext的XML代码:Android EditText:希望光标总是在用户进行一些有效输入之前显示出来吗,android,android-edittext,cursor,Android,Android Edittext,Cursor,我正在做我的第一个android应用程序,我有一个编辑文本区域,我需要光标始终显示在其中。这里的“总是显示”意味着即使用户第一次点击编辑文本,光标也应该显示,而不是在用户真正输入内容后才显示 为了清楚起见,请参考第一张图片,当我第一次点击edittext区域时,您可以看到,只有softInputMethod显示,但edittext没有光标: 请参考第二张图片,你可以发现只要我输入了有效的信息,光标就会显示: 那么,有谁能告诉我如何使光标始终显示,甚至在我真正进行一些有效输入(使光标显示在第一
<EditText
android:id="@+id/typing_text"
android:background="@color/white"
android:hint="@string/typing_text_hint"
android:gravity="top"
android:textColorHint="@color/gray"
android:textColor="@color/black"
android:lines="6"
android:lineSpacingMultiplier="1"
android:digits="@string/digits"
android:imeOptions="actionDone"
android:inputType="textLongMessage|textMultiLine|textAutoCorrect|textCapSentences"
android:layout_marginBottom="7dp"
android:layout_marginLeft="2dp"
android:layout_marginRight="2dp"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:longClickable="false"
android:cursorVisible="true"
android:maxLines="10"
android:scrollbarStyle="outsideInset"
android:scrollbars="vertical" />
如上所述,这里是实际行
android:textCursorDrawable=“@null”
您是否可以更新您声明此活动的清单。上面的xml代码对我来说似乎没有问题。我可以随时看到光标:-s
As mentioned above, here's the actual line
android:textCursorDrawable="@null"
<EditText
android:textCursorDrawable="@null"
android:imeOptions="actionNext"
android:id="@+id/edSMobile"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@drawable/edit_corner"
android:inputType="phone" />