当有更多内容时,我正试图制作ScrollView Fading的边缘,问题是有褪色发生但是很短,很难看到即使我改变了褪色边长,这是我用来制作衰落边缘的代码:
fullArticleScrollView = (ScrollView) findViewById(R.id.FullArticleScrollView);
fullArticleScrollView.setFadingEdgeLength(20);
fullArticleScrollView.setVerticalFadingEdgeEnabled(true);
这是xml文件:
<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/FullArticleScrollView"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="#000000"
android:fillViewport="true"
android:orientation="vertical"
android:requiresFadingEdge="vertical"
tools:context="com.cloudappers.twocents.FullArticleActivity" >
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="#FFFFFF"
android:orientation="vertical">
<TextView
android:id="@+id/fullArticleTitleTextView"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Large Text"
android:textAppearance="?android:attr/textAppearanceLarge" />
<TextView
android:id="@+id/articleContentTextView"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Medium Text"
android:textAppearance="?android:attr/textAppearanceMedium" />
</LinearLayout>
</ScrollView>
我在Android 4.2上测试