8

I have a long text with multiple lines. I want to wrap the TextView inside the ScrollView such that the edge of ScrollView apply a TEMPORARY alpha gradient TextView as the user scroll the text. The fading does not appear at all.

I intentionally set a high value for height of TextView but it doesn't work yet neither with this or WRAP_CONTENT or even MATCH_PARENT.

<ScrollView android:layout_width="match_parent"
            android:layout_height="300dp"
            android:requiresFadingEdge="vertical"
            android:fadingEdgeLength="200dp">
    <TextView
            android:layout_width="match_parent"
            android:layout_height="1000dp"
            android:text="He has been involved with various online encyclopedia projects.[7]\nHe is the former editor-in-chief of Nupedia,[8] chief organizer (2001–02) of its successor, Wikipedia,[9] and founding editor-in-chief of Citizendium.[10]\nFrom his position at Nupedia, he assembled the process for article development.[11] Sanger proposed implementing a wiki, which led directly to the creation of Wikipedia.[12]\nInitially Wikipedia was a complementary project for Nupedia.[12]"
            android:id="@+id/textView"
            android:textSize="20sp"
            android:textAlignment="gravity"
            android:gravity="center_horizontal"/>
</ScrollView>

All I could achieve was to remove the ScrollView and obtain a permanent alpha gradient on TextView

enter image description here

Mohsen Afshin
  • 13,273
  • 10
  • 65
  • 90

0 Answers0