質問

I'm using the following layout for dialog window:

<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="fill_parent"
android:layout_height="fill_parent" 
android:colorBackground="#ff0000">
<WebView
    android:id="@+id/webViewNote1"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:layout_alignParentLeft="true"
    android:layout_alignParentTop="true"
    android:colorBackground="#ff0000" />

As you can see I tried to change the color in the RelativeLayout and in the WebView but nothing happen and I still have a white background.

Any idea how to change background in regular dialog (not alert dialog)?

役に立ちましたか?

解決

Apply background color in parent view of webview. and make webview background transperent like this way.

mWebView.setBackgroundColor(0x00000000);

EDIT:

How to make custom Dialog?

https://stackoverflow.com/a/18224754/942224

https://stackoverflow.com/a/23109450/942224

他のヒント

change

android:colorBackground="#ff0000"

to

android:background="#ff0000"

for your RelativeLayout

ライセンス: CC-BY-SA帰属
所属していません StackOverflow
scroll top