它被称为文本选择句柄。
有一个巧妙的方法可以隐藏它:在你的style.xml中,将其替换为一个0像素透明的可绘制对象。
drawable/zero_px_transparent.xml
<?xml version="1.0" encoding="UTF-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android" android:shape="rectangle" >
<size android:height="0dp" android:width="0dp"/>
</shape>
并修改您的style.xml:
<style name="CustomTheme" parent="@android:style/Theme.Holo.Light">
<item name="android:textSelectHandleLeft">@drawable/zero_px_transparent</item>
<item name="android:textSelectHandleRight">@drawable/zero_px_transparent</item>
<item name="android:textSelectHandle">@drawable/zero_px_transparent</item>
</style>
ActionMode.Callback
并重写 onCreateActionMode
方法,返回 false 或者空菜单,然后调用 EditText.setCustomSelectionActionModeCallback
。 - anhtuannd
android:cursorVisible =“false”
- Smit