我在Android中使用editText,但是当我想要在ediTText中选择,复制或粘贴文本/数字时,这是不可能的,也就是说,如果我按(长按)不显示菜单来选择“粘贴”或其他任何内容。接下来是我的xml文件(EditText)中的代码:
<com.rengwuxian.materialedittext.MaterialEditText
android:id="@+id/titulo_articulo_periodico"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_margin="4dp"
android:maxLines="1"
android:inputType="text"
android:singleLine="true"
android:textIsSelectable="true"
android:hint="@string/periodico_hint1"
android:textColor="@color/text_color"
app:met_primaryColor="@color/refresco"
app:met_clearButton="true"/>
我使用“材料EditText”库(github:https : //github.com/rengwuxian/MaterialEditText),但我看不到代码和所有者代码之间的区别,我的朋友告诉我,我需要在每个editText中使用onActionItemClicked ,但是使用此代码,我的Java代码太长。我不知道该怎么办,我很累。:(
我认为没有捷径可走。您必须使用Clipboard Manager,并且要花很长的时间来实现该功能。我仍在寻找一个简单的解决方案。在此之前,请参阅此链接https://developer.android.com/guide/topics/text/copy-paste.html
本文收集自互联网,转载请注明来源。
如有侵权,请联系[email protected] 删除。
我来说两句