textIsSelectable无法与Edittext一起使用 [英] textIsSelectable not working with Edittext
问题描述
我在这里看到过很多这样的问题,也有很多解决方案,但对我来说没有任何作用。下面是我的EditText xml
I have seen many question like this here and lots of solution but nothing is working for me. below is my EditText xml
<EditText
android:id="@+id/summary_edittextview"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="16dp"
android:layout_marginRight="16dp"
android:layout_marginTop="10dp"
android:lines="15"
android:maxLength="1000"
android:textIsSelectable="true"
android:textSize="16dp"
android:backgroundTint="@color/colorPrimaryDark"/>
我尝试执行textIsSelectable = true,这会使edittext禁用并且什么也没有发生,我尝试使用cursorVisible = true但这也不能解决我的问题。请帮助我要允许用户复制EditText内的文本
I tried to do textIsSelectable=true which makes edittext disable and nothing happens, I tried using cursorVisible=true but that also does not solve my problem. Please help i want to allow user to copy text which is inside EditText
更多详细信息:-
此EditText在片段布局下,我正在使用此样式作为应用程序主题
More Details:- This EditText is under layout of fragment and I am using this style as app theme
<style name="AppTheme.Dark" parent="Theme.AppCompat.Light.NoActionBar">
即使我删除了textIsSelectable = true,它也不起作用。请帮助我在哪里做错了。
even if i remove textIsSelectable=true it doesn't work. Please help me where i am doing mistake.
推荐答案
正如@Ashwin Mothilal所说,您想做什么?
As @Ashwin Mothilal said What do you want to do?
好的。仅供参考,textIsSelectable表示可以选择不可编辑的TextView的内容。
OK fine. FYI, textIsSelectable is indicates that the content of a non-editable TextView can be selected.
(始终可以选择EditText,因此对于EditText而言,不需要textIsSelectable。)
(An EditText is always selectable, so textIsSelectable is not necessary for an EditText.)
如果您将android:textIsSelectable添加到EditText,则文本是可选的,但该字段不可编辑,光标也不可见。
If you DO add android:textIsSelectable to a EditText the text IS selectable, but the field is NOT editable, nor is the cursor visible.
这篇关于textIsSelectable无法与Edittext一起使用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!