Android Java:EditText文本选择缺少上下文菜单

所以我当前正在编写一个android应用程序,该应用程序会打开一个带有自定义视图的对话框。

该自定义视图包含一个EditText(多行显示,因此您可以输入更长的消息文本)。如果用户输入较长的文本消息,然后尝试选择该文本中的某些单词,则不会显示上下文菜单(用于复制,粘贴等的菜单):

Android Java:EditText文本选择缺少上下文菜单

当我什么都没选择时,只需点按文本,上下文菜单就会自动出现。

Android Java:EditText文本选择缺少上下文菜单

这是我的布局代码:

<EditText
            android:id="@+id/Caption"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_weight="1"
            android:background="@null"
            android:cursorVisible="true"
            android:ems="10"
            android:fadeScrollbars="false"
            android:focusable="true"
            android:focusableInTouchMode="true"
            android:gravity="top"
            android:hint="@string/L_RepostCaptionDialog_TextAreaHint"
            android:inputType="textMultiLine|textEmailaddress"
            android:maxLength="2199"
            android:maxLines="12"
            android:minHeight="120dp"
            android:paddingLeft="25dp"
            android:paddingTop="25dp"
            android:paddingRight="25dp"
            android:paddingBottom="30dp"
            android:scrollbars="vertical"
            android:textColor="#333"
            android:textColorHint="#999999"
            android:textIsSelectable="true"
            android:textSize="11.5dp" />

我在不同的活动上具有相同的EditText和相同的功能-效果很好。唯一的区别是,其中一个在对话框中(不起作用),另一个在活动中(可以正常工作)。

有什么建议吗?预先感谢。

cadlovehmy 回答:Android Java:EditText文本选择缺少上下文菜单

暂时没有好的解决方案,如果你有好的解决方案,请发邮件至:iooj@foxmail.com
本文链接:https://www.f2er.com/3086021.html

大家都在问