So I have a ScrollView
which has a TextView
inside. When the String
for the text is longer than the screen width, It simply shifting in the next line. I want to avoid the new lining by adding HorizontalScrolling
in ScrollView
. Also, I want to make the text selectable so the user can copy the text. Is it possible?
<ScrollView
android:id="@+id/scroll_view"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:fillViewport="true">
<TextView
android:id="@+id/text_view"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginStart="15dp"
android:layout_marginEnd="15dp"
android:layout_marginBottom="15dp"
android:ellipsize="end"
android:textIsSelectable="true"
android:justificationMode="inter_word"
android:lineSpacingExtra="5dp"
android:textSize="15sp"
tools:targetApi="o" />
</ScrollView>