Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/android/206.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Java 多个文本选择句柄-Android Studio_Java_Android_Android Edittext_Cursor_Handle - Fatal编程技术网

Java 多个文本选择句柄-Android Studio

Java 多个文本选择句柄-Android Studio,java,android,android-edittext,cursor,handle,Java,Android,Android Edittext,Cursor,Handle,当我尝试从编辑文本中选择文本时,会出现多个(每侧可能有4个)文本选择手柄,而不是每种类型中的一个 如何才能为每种类型(右、左)仅获取一个处理程序 我的布局: <?xml version="1.0" encoding="utf-8"?> <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools"

当我尝试从编辑文本中选择文本时,会出现多个(每侧可能有4个)文本选择手柄,而不是每种类型中的一个

如何才能为每种类型(右、左)仅获取一个处理程序

我的布局:

<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:elevation="10dp">
<EditText
    android:id="@+id/editBinary"
    android:layout_width="200dp"
    android:layout_height="50dp"
    android:layout_alignLeft="@+id/editHexadecimal"
    android:layout_alignStart="@+id/editHexadecimal"
    android:layout_alignTop="@+id/textBinary"
    android:background="@drawable/background"
    android:digits="01"
    android:ems="10"
    android:inputType="numberDecimal"
    android:maxLines="1"
    android:singleLine="true"
    android:padding="10dp"
    android:textAppearance="@style/TextAppearance.AppCompat.Caption"
    android:textColor="@android:color/white"
    android:textSize="20sp" />
</RelativeLayout>

请包括一个最低限度的样本来复制这个问题。你用过定制的抽绳吗?您在布局中使用什么代码?你如何从代码中调用它?@DavidMedenjak我包括了我的代码示例。我使用了自定义背景,但不使用时仍然存在问题。我还添加了一种字体,但当我不使用它时,我再次遇到同样的问题。
    editBinary=(EditText)rootView.findViewById(R.id.editBinary);
    Typeface typeface = Typeface.createFromAsset(getContext().getAssets(), "fonts/Roboto-Regular.ttf");
    editBinary.setTypeface(typeface);