次の設定で、レイアウトに単純な WebView があります
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/rootView"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:background="@drawable/baserepeat"
android:gravity="top|center_horizontal"
android:orientation="vertical"
android:paddingBottom="20dp"
android:paddingLeft="20dp"
android:paddingRight="20dp" >
<WebView
xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/productDetailContentWebview"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_gravity="top"
android:background="@drawable/baserepeat" />
//other items...
私のマニフェスト内には、含むアクティビティがに設定されています
<activity
android:name=".Products.ProductDetailActivity"
android:configChanges="keyboardHidden|orientation|screenSize"
android:screenOrientation="sensor"
android:theme="@style/Theme.CPS" >
</activity>
私の Webview には、デバイス上の単純な HTML ファイルが取り込まれており、うまく機能しています。問題は、デバイスを縦向きから横向きに回転させると、Web ビューの高さがかなり高くなり、その下にあるものがレイアウト内でさらに下に押し出されることです。コンテンツの量は変わりません。すべて OnCreate() で設定されます。
私は Webview を使用して、独自の特別なスタイルシートでコンテンツをレンダリングしていますが、ScrollView 内にとどまる必要があります。
必要に応じて、より多くの情報を提供できます:)