textview textIsSelectable=“true” not working in Listview

后端 未结 3 1888
别跟我提以往
别跟我提以往 2021-01-18 15:09
 

        
相关标签:
3条回答
  • 2021-01-18 15:35

    Remove the textIsSelectable, instead use:

    android:inputType="textMultiLine"
    

    The text will be selectable and editable.

    0 讨论(0)
  • 2021-01-18 15:41

    Remove android:descendantFocusability="blocksDescendants"​ in the recyclerview or listview to prevent the blocking of selection

    Also, change the textview layout width from match_parent to wrap_content to prevent the selectable text feature to be disabled when reusing the text cell.

    0 讨论(0)
  • 2021-01-18 15:46

    In my case it wasn't working because I had textView in xml layout with android:visibility="gone" property and made it visible later in adapter code. So, you need call this after you makes textview visible

    textView.setTextIsSelectable(true); 
    
    0 讨论(0)
提交回复
热议问题