我在我的布局中添加了一个WebView来显示对齐的文本.我想将WebView的背景设置为透明,使其看起来像textView.这是我做的:
WebView synopsis;
synopsis=(WebView)findViewById(R.id.synopsis);
synopsis.setBackgroundColor(0x00000000);
Run Code Online (Sandbox Code Playgroud)
它适用于模拟器,但是当我在我的设备上运行应用程序时它不起作用:我得到的是白色背景.
String textTitleStyling = "<head><style>* {margin:0;padding:0;font-size:20; text-align:justify; color:#FFFFFF;}</style></head>";
String titleWithStyle = textTitleStyling + "<body><h1>" + movie.synopsis + "</h1></body>";
synopsis.loadData(textTitleStyling + movie.synopsis, "text/html", "utf-8");
synopsis = (WebView) findViewById(R.id.synopsis);
synopsis.getSettings();
synopsis.setBackgroundColor(0);
Run Code Online (Sandbox Code Playgroud) 我正在开发Phonegap中的应用程序.我已经启用<preference name="webviewbounce" value="true" />了我的config.xml.
我android:theme="@android:style/Theme.Holo.Light.NoActionBar"在Manifest.xml中使用.
问题是.我的index.html文件是红色背景.因此,当我在应用程序中向上滚动它在底部反弹,我看到白色背景:(.它真的很烦人,破坏了整个应用程序的外观.
所以现在我想将白色背景改成其他颜色.或者我想使用一些图像作为webview的背景.
我正在使用phonegap.2.7.0请帮我解决这个问题.