入力フォームとWebViewを含むアプリを作成しています。プロジェクトはhttp://code.google.com/p/android-sap-note-viewer/で入手できます。
WebViewは入力に基づいてWebサイトをレンダリングし、このページにはメインコンテンツ(数百行になる可能性があります)を含むDIVがあります。私はウェブサイトの内容を管理することはできません。
Android WebKitは、DIVでスクロールを実行しないようです。http://www.gregbugaj.com/?p=147を参照してください。したがって、DIVの一部のみがユーザーに表示され、残りのテキストを取得する方法はありません。私の課題は、DIVのすべてのテキストが表示される方法を見つけることです。
私の見解は次のように定義されています。
<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>
ここでは、DIVが引き伸ばされてすべてのテキストが表示されることを確認し、LinearLayoutにスクロールを強制するために、WebViewを大きな高さにハードコーディングしようとしました。
ただし、WebViewは常に画面サイズに適応しています(ほとんどの場合、これは適切ですが、これは適切ではありません)。
この問題を解決する方法について何かアイデアはありますか?
(私が今見ている唯一の解決策は、自分でHTMLをフェッチし、DIVを削除して、それをWebViewに送信することです)