android - 如何在TextView中显示EditText闪烁的光标?

标签 android android-edittext textview responsive

我计划使用 TextView 而不是 Button 和 EditText(遵循我之前的 post )。但是当我将它用作 EditText 时,如何在 TextView 中表示 EditText 的闪烁光标? 事实上,我想将 TextView 用作 EditText,因为 EditText 在 SDK 26 之前没有 AutoSizeText 属性,但 TextView 有。

提前致谢。

最佳答案

你可以看看这个属性 android:textEditPasteWindowLayout

<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Your text"
android:hint="My hint"
android:textEditPasteWindowLayout="@layout/editextView"
style="@android:style/Widget.EditText"/>

关于android - 如何在TextView中显示EditText闪烁的光标?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/52655730/

相关文章:

android - 在一个 Visual Studio 上同时调试浏览器中的 API 和模拟器中的 Android 应用程序

Android:动画编辑文本的问题?

android - 如何在 Android TextView 中更改文本

android - 当手机方向发生变化时,EditText 如何保留其值而不是 textview?

java - 如何在MainActivity之外的另一个类中调用findViewById(R.id.textView)?

Android 应用程序在被杀死时不调用 "onDestroy()"(ICS)

android - EditText setInputType(InputType.TYPE_CLASS_NUMBER);不工作

android - 如何在 Textview 中显示整个内容,如屏幕截图所示,向左向右滚动而不是从上向下滚动?

android - Howler JS 2.0-Cordova,Android,设备上未播放声音

android - EditText 只允许 8 个字符