Hi,
I am building an app which contains an input form and a WebView. The project is available at http://code.google.com/p/android-sap-note-viewer/
The WebView will render a website based on the input and this page has a DIV with the main contents (could be hundreds of lines). I have no control of the contents on the website.
Android WebKit doesn't seem to do any scrolling in a DIV, ref http://www.gregbugaj.com/?p=147. Therefore, only parts of the DIV is shown to the user, with no method of retrieving the rest of the text. My challenge is to find a way that all the text of the DIV is shown.
My view is defined as the following:
<LinearLayout android:orientation="horizontal"
android:layout_width="fill_parent"
android:layout_height="wrap_content">
<TextView android:layout_width="wrap_content"
android:textAppearance="?android:attr/textAppearanceMedium"
android:layout_height="wrap_content"
android:text="@string/lblNote" />
<EditText android:id="@+id/txtNote"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
android:numeric="decimal"
android:maxLength="10"
/>
<Button android:id="@+id/bView"
android:text="@string/bView"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
/>
</LinearLayout>
<WebView
android:id="@+id/webview"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:isScrollContainer="false"
android:keepScreenOn="false"
android:minHeight="4096px"
/>
</LinearLayout>
Here I've tried to hardcode the WebView to a large height in order to make sure the DIV is stretched out and shows all the text, and also force the LinearLayout to do the scrolling.
However, the WebView is always adapting to the screen size (which would be good in most cases, but not this).
Any ideas on how to solve this problem?
(only solution I see now is to fetch the HTML myself, remove the DIV and send it to the WebView)