Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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?

like image 803
DANGERZONE94 Avatar asked Apr 18 '16 21:04

DANGERZONE94


1 Answers

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>
like image 122
Jonik Avatar answered Nov 06 '22 01:11

Jonik