Warning: file_get_contents(/data/phpspider/zhask/data//catemap/5/url/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/gwt/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Url 如何在uibinder(GWT)中为ClientBundle资源设置背景图像_Url_Gwt_Uibinder - Fatal编程技术网

Url 如何在uibinder(GWT)中为ClientBundle资源设置背景图像

Url 如何在uibinder(GWT)中为ClientBundle资源设置背景图像,url,gwt,uibinder,Url,Gwt,Uibinder,如何将uibinder/java中的背景图像设置为ClientBundle中的图像,而不使用: obj.getElement().getStyle().setBackgroundImage("url("+Images.INSTANCE.bg().getURL()+")"); 因为这在IE中不起作用(FF是可以的)。 我想我应该直接在uibinder中用css@url设置背景图像,或者 (我正在使用GWT 2.0.3) 关于解释:)(请注意,UiBinder内部使用了CssResource,因此

如何将uibinder/java中的背景图像设置为ClientBundle中的图像,而不使用:

obj.getElement().getStyle().setBackgroundImage("url("+Images.INSTANCE.bg().getURL()+")");
因为这在IE中不起作用(FF是可以的)。 我想我应该直接在uibinder中用css@url设置背景图像,或者

(我正在使用GWT 2.0.3)

关于

解释:)(请注意,UiBinder内部使用了
CssResource
,因此所有适用于
CssResource
,也适用于您在UiBinder的
中定义的CSS样式)

图像资源使用数据URL和spring。遗憾的是,旧版本的IE都不支持这两个功能。数据Url根本不受支持,在i.e.7上-图像的每个剪裁外观都使用整个sprite图像的新副本。因此,如果你有一个有100个图标的精灵,并在100个地方使用它,IE将消耗该图像100倍的内存

如果可以的话,试着远离真正的老人