我不只是寻找API中的开机画面功能;如果可能的话,我想的HTML内容使用透明背景,并依靠web视图提供背景图像。这样的事情可能吗?
I'm not just looking for the Splash Screen functionality in the API; if possible, I would like the HTML content to use a transparent background, and lean on the WebView to supply the background image. Is such a thing possible?
除了上述,我可以至少设置,将流血通过为HTML内容的WebView背景颜色?
Barring that, can I at least set a background color on the WebView that will "bleed through" to HTML content?
想通挖科尔多瓦来源和Android文档后出来。在SRC / COM /.../ MyApp.java:
Figured it out after digging in Cordova source and Android docs. In src/com/.../MyApp.java:
public class MyApp extends DroidGap
{
@Override
public void onCreate(Bundle savedInstanceState)
{
super.onCreate(savedInstanceState);
super.loadUrl(Config.getStartUrl(), 20000);
// Must be after loadUrl!
super.appView.setBackgroundColor(0x00000000); // transparent RGB
super.appView.setLayerType(WebView.LAYER_TYPE_SOFTWARE, null);
// Put background image in res/drawable/splash.jpg
Drawable theSplash = getResources().getDrawable(R.drawable.splash);
super.root.setBackground(theSplash);
}
}
和CSS的:
html,
body,
.transparent { background-color: transparent !important; }
上一篇:SSLProtocolException阅读在Android 2.3.3设备的https响应时设备、Android、SSLProtocolException、https
下一篇:阅读使用DataContractJsonSerializer JSONDataContractJsonSerializer、JSON