DANGERZONE94
DANGERZONE94

Reputation: 139

How to fade bottom edge of a scrollable TextView?

I have a scrollable textview that I want to fade the bottom edge. I tried:

android:requiredFadingEdge="vertical"

but that only fades the top. How do I fade the bottom instead of the top?

Upvotes: 6

Views: 2597

Answers (1)

Jonik
Jonik

Reputation: 81751

If your scrollable TextView happens to be implemented by wrapping it in a ScrollView, then quite simply add android:requiresFadingEdge and android:fadingEdgeLength for the ScrollView.

<ScrollView
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:requiresFadingEdge="vertical"
    android:fadingEdgeLength="@dimen/spacing_small">    

    <TextView
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:scrollbars="vertical" />

</ScrollView>

Upvotes: 5

Related Questions