我试图为简单的HorizontalScrollView添加褪色的边。关于fadingEdge属性的文档:
这个属性被弃用,并将在APILevel14 (ICE_CREAM_SANDWICH)时被忽略。使用褪色的边缘可能会带来明显的性能下降,只有在应用程序的视觉设计需要时才能使用。若要请求API级别14及以上的渐变边缘,请使用android:requiresFadingEdge属性。
好的,但是这个布局也没有显示任何褪色的边缘:
<HorizontalScrollView xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/horizontalScrollView1"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:requiresFadingEdge="horizontal"
android:fadingEdgeLength="50dp"
tools:context=".MainActivity" >
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:orientation="horizontal" >
<TextView
android:id="@+id/textView1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="TextView" />
...
</LinearLayout>
</HorizontalScrollView>我遗漏了什么?
发布于 2014-07-19 04:36:28
尝试使用android:overScrollMode属性。
只需加上
android:overScrollMode="always"敬你的HorizontalScrollView。
android:overScrollMode可以有三个值:“总是”、“从不”、"ifContentScrolls“。
发布于 2021-01-28 07:30:05
只管用
android:requiresFadingEdge="horizontal|vertical"
android:fadingEdgeLength="10dp"https://stackoverflow.com/questions/19676845
复制相似问题