android - 如何淡化可滚动 TextView 的底部边缘?

标签 android textview

我有一个可滚动的 TextView ,我想淡化底部边缘。我试过:

android:requiredFadingEdge="vertical"

但这只会淡化顶部。如何淡化底部而不是顶部?

最佳答案

如果您的可滚动 TextView 恰好是通过将其包装在 ScrollView 中实现的,那么只需添加 android:requiresFadingEdge android:fadingEdgeLength 用于 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>

关于android - 如何淡化可滚动 TextView 的底部边缘?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/36704519/

相关文章:

java - 如何解决 "adapter cannot be applied"错误?

android - 如何实现内存缓存?

java - Eclipse 中 Gradle 的协助

Android TextView 对齐文本

android - 使 TextView 使用具有不同样式(常规和斜体)的自定义字体

java - 自定义操作栏停止我的应用程序

android - RecyclerView 中项目的 layout_weight 和 layout_gravity 不起作用

android - Android 中不存在 TextView.getAlpha

Android Textview 内容大小

android - 在 textAllCaps 上设置 textColorLink?