Issue
I have an activity which is basically just a WebView which loads some inline HTML and when the user scrolls I want the edges to fade. I know this isn't complicated, and I have it working on a bunch of other activities with ListViews and so on, but I can't seem to figure this out.
Here is the XML for the activity:
<?xml version="1.0" encoding="utf-8"?>
<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/scrollview"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
android:paddingBottom="5dp"
android:paddingLeft="@dimen/activity_horizontal_margin"
android:paddingRight="@dimen/activity_horizontal_margin"
android:paddingTop="5dp"
android:requiresFadingEdge="vertical"
android:scrollbarStyle="outsideOverlay"
android:scrollbars="vertical" >
<RelativeLayout
android:layout_width="fill_parent"
android:layout_height="wrap_content" >
<WebView
android:id="@+id/browser"
android:layout_width="match_parent"
android:layout_height="wrap_content" />
</RelativeLayout>
</ScrollView>
If anyone can point me in the right direction, I'd appreciate it. I'm open to all (constructive) ideas.
Oh, and I also set ((ScrollView)findViewById(R.id.scrollview)).setVerticalFadingEdgeEnabled(true);
programmatically right now too.
Solution
Odd, but, here's what solved my issue:
<?xml version="1.0" encoding="utf-8"?>
<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/scrollview"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:background="@drawable/transparent"
android:orientation="vertical"
android:paddingBottom="5dp"
android:paddingLeft="@dimen/activity_horizontal_margin"
android:paddingRight="@dimen/activity_horizontal_margin"
android:paddingTop="5dp"
android:scrollbarStyle="outsideOverlay"
android:scrollbars="vertical" >
<WebView
android:id="@+id/browser"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="@drawable/transparent" />
</ScrollView>
Answered By - whitfin
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.