如何淡出Horizo ntalScrollView的结尾?

问题描述 投票:0回答:3

我将HorizontalScrollView包裹在TabLayout上并且效果很好,但是很难知道它实际上是水平滚动。

我如何使末端变淡,或者在末端放置箭头以向用户提供足够的滚动指示?

<< img src =“ https://image.soinside.com/eyJ1cmwiOiAiaHR0cHM6Ly9pLnN0YWNrLmltZ3VyLmNvbS9jVkhUYy5wbmcifQ==” alt =“在此处输入图像说明”>

    <HorizontalScrollView
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:scrollbars="none"
        android:fillViewport="true">
        <android.support.design.widget.TabLayout
            android:id="@+id/tabs"
            android:layout_width="match_parent"
            android:layout_height="wrap_content" />
    </HorizontalScrollView>
android material-design horizontalscrollview
3个回答
2
投票

嘿,我对您的问题没有适当的主意,但这是一个类似的问题。签出。

making the edge of the scrollview fade when scrolling in android


1
投票

您可以通过覆盖半透明的ImageView并仅在未完全滚动时才显示它来执行此操作。


0
投票

这将使左边缘和右边缘具有褪色的外观:

<android.support.design.widget.TabLayout
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:requiresFadingEdge="horizontal"
            android:fadingEdgeLength="80dp">
© www.soinside.com 2019 - 2024. All rights reserved.