0

Je développe une application Android. C'est comme un article de lecture d'application dans lequel il y a beaucoup de textview (plus de 10) sous une activité. Comme -Comment rendre plusieurs affichages de texte sélectionnables dans une activité?

<?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="wrap_content" android:paddingBottom="@dimen/activity_vertical_margin" android:paddingLeft="@dimen/activity_horizontal_margin" android:paddingRight="@dimen/activity_horizontal_margin" android:paddingTop="@dimen/activity_vertical_margin" tools:context=".EnviarMensaje"> 
    <TextView android:id="@+id/textView1" android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="My text is here" android:textSize="20sp" /> 
    <TextView android:id="@+id/textView2" android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="My text is here" android:textSize="20sp" /> 
    <TextView android:id="@+id/textView3" android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="My text is here" android:textSize="20sp" /> 
</RelativeLayout> 

Je veux faire tous ces sélectionnables textview lorsque l'utilisateur touche pendant une longue période sur le texte, une option devrait venir « tout sélectionner ». Et lorsque vous choisissez l'option tout sélectionner, le texte de tous Textview (De textView 1 à textView3) doit sélectionner. J'ai essayé - android: textIsSelectable = true Mais après l'avoir appliqué, lorsque je choisis toute option, le texte est sélectionné parmi textView1 ou textView2. Non sélectionné tout le texte sur l'écran ensemble. S'il vous plaît aidez-moi.

Répondre