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