问题是有一个编辑文本,我想将它设置为默认有一个光标(但不是焦点和隐藏键盘)
尝试
android:textCursorDrawable="@null"
android:cursorVisible="true"
<EditText
android:id="@+id/comment"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_margin="1dp"
android:background="@drawable/comment"
android:hint="@string/cmt"
android:paddingLeft="5dp"
android:paddingRight="5dp"
android:textColor="#AAACAD"
android:textColorHint="#AAACAD"
android:textCursorDrawable="@null"
android:cursorVisible="true"
android:textSize="15sp" />
但不起作用。请帮忙。非常感谢
最佳答案
@user782104
您可以在声明该 Activity 的 AndroidManifest.xml
文件中使用此属性 android:windowSoftInputMode="stateHidden"
。
这样光标会在编辑文本中,但键盘不会显示。
关于android - 设置特定的edittext在进入页面时光标闪烁,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/28738938/