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
Gwt 背景图像_Gwt - Fatal编程技术网

Gwt 背景图像

Gwt 背景图像,gwt,Gwt,我使用gwt在td中显示动态图像,图像来自imagebundle,但它在td中显示整个大图像,gwt在编译过程中制作的大图像,而不是显示大图像中的特定部分。我不知道我在这里错过了什么。。。问题是图像将被动态添加和选择,我不能每次添加图像时都定义css。如果你们有人能帮我的话。这是我的密码 我的表格单元格定义在UiBinder中,类似于 <ui:style> .colourPickerCell { background-repeat

我使用gwt在td中显示动态图像,图像来自imagebundle,但它在td中显示整个大图像,gwt在编译过程中制作的大图像,而不是显示大图像中的特定部分。我不知道我在这里错过了什么。。。问题是图像将被动态添加和选择,我不能每次添加图像时都定义css。如果你们有人能帮我的话。这是我的密码

我的表格单元格定义在UiBinder中,类似于

    <ui:style>
          .colourPickerCell {
             background-repeat:no-repeat;
          }
    </ui:style>

         <tr>
            <td class="{style.colourPickerCell}" ui:field="colourPreviewSlot" rowspan="3" width="50%"></td>
        </tr> 
调试代码时,patternImage对象的html如下所示:

            <img id="..." style="backgrond:url(....) no-repeat -149px 12px;"/>


最好的祝愿,

如果您将此图像用作背景精灵,它会认为您必须使用css属性将图像“移动”到td后面

“left”和“top”属性与设置样式的元素相关,而不是其基础背景图像

            <img id="..." style="backgrond:url(....) no-repeat -149px 12px;"/>