Web ビューを使用しています。Android 2.3で問題なく動作しています。Android 4.0では背景として白い画面が表示されています。データを確認したところ、データが画面に表示されますが、指定した背景の場所に自動的に白い背景が表示されます。また、この白い背景を透明にしようとしましたが、Android 4.0 では機能しません。私の問題に関連するコードを提供しています。これは webView.xml です
<ImageView
android:id="@+id/backButtonZodiacSign"
android:layout_width="wrap_content"
android:layout_height="0dp"
android:layout_marginLeft="10dp"
android:layout_weight="0.09"
android:contentDescription="@drawable/back3"
android:src="@drawable/back3" />
<ScrollView
android:id="@+id/zodiac_calender_scroll"
android:layout_width="wrap_content"
android:layout_height="0dp"
android:layout_weight="0.91" >`<WebView
android:id="@+id/webViewZodiacCalender"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@android:color/transparent"
android:layerType="software"
android:layout_alignParentBottom="true"
android:layout_below="@+id/zodiac_calender_relative"
/>
</ScrollView>
</LinearLayout>
アクティビティ ファイル -> ここでは、html データは他のアクティビティから動的に取得されます。
String sign = null;
sign = savedInstanceState.getString("zodiacSign");
zordic_calender_sign = (TextView) findViewById(R.id.zodiac_calender_sign);
zordic_calender_sign.setText(sign.substring(0, 1).toUpperCase()
+ sign.substring(1));
image = (ImageView) findViewById(R.id.zodiac_calender_image);
String uriZodiacSign = "drawable/" + sign;
int imageZodiacSign = getResources().getIdentifier(uriZodiacSign, null,
getPackageName());
Drawable drawableZodiacSign = getResources().getDrawable(
imageZodiacSign);
image.setImageDrawable(drawableZodiacSign);
webView = (WebView) findViewById(R.id.webViewZodiacCalender);
backButton = (ImageView) findViewById(R.id.backButtonZodiacSign);
webView.setBackgroundColor(Color.TRANSPARENT);
webView.loadUrl("file:///android_asset/" + sign + ".html");
私を助けてください.... :(