我将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>
嘿,我对您的问题没有适当的主意,但这是一个类似的问题。签出。
making the edge of the scrollview fade when scrolling in android
您可以通过覆盖半透明的ImageView并仅在未完全滚动时才显示它来执行此操作。
这将使左边缘和右边缘具有褪色的外观:
<android.support.design.widget.TabLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:requiresFadingEdge="horizontal"
android:fadingEdgeLength="80dp">