Webビューの作成方法は、親レイアウトの幅と高さが-10dpで、背景画像は次の画像のようになります。
更新:青いボックスが画面です。黒いボックスは外側のレイアウト(@ + id /wrapper)で、赤いボックスはwebview(@ + id / webview)です。緑のボックスは他のレイアウトです。
次のコードで試しましたが、成功しません。Webビューのコンテンツが長すぎると、外側のレイアウトが伸びます。レイアウト内に固定サイズのWebビューが必要ですが、これを実現する方法がわかりません。
追伸 ブラックボックスの背景画像が全画面表示ではありません。
誰かが私にいくつかのヒントをくれますか?
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@drawable/common_background" >
... some other layout ...
<LinearLayout
android:id="@+id/wrapper"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_centerInParent="true"
android:background="@drawable/wrapper_background" >
<WebView
android:id="@+id/webview"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_margin="10dp" />
</LinearLayout>
... some other layout ...
</RelativeLayout>