0

ラベルをカスタマイズして、グリッドの 1 つのセルにラベルの名前を配置し、次のセルにアスタリスク (画像) を配置しました。

<ui:image field="requiredImage" src="images/required_indicator.gif"/>
<ui:style type="com.equillore.mcmexternal.client.ui.IndicatorLabel.Style">
    @sprite 
    .requiredAsterisk
     {
        gwt-image: 'requiredImage';
        width: 7px;
        height: 14px;
    }
    .labRequired
    {
        color:#B22222;
        font-size:14;
        font-style:normal;
        font-weight:bold;
        font-family: serif;
        letter-spacing: 0.07em; 
    }
</ui:style>
<g:Grid >
    <g:row>
        <g:customCell>
            <g:Label ui:field="label" addStyleNames="{style.labRequired}"/>
        </g:customCell>
        <g:customCell>
            <g:Label addStyleNames="{style.requiredAsterisk}"/>
        </g:customCell>
    </g:row>
</g:Grid>

ただし、これを実行すると、アスタリスク画像がラベル(labRequired)の前とその直後に表示されます。そのため、2 回表示されます。

なぜこれが起こっているのですか?「余分な」アスタリスク画像を取り除くにはどうすればよいですか?

敬具

4

1 に答える 1

1
<ui:image field="requiredImage" src="images/required_indicator.gif"/>

この行は、実際に UIBinder に画像を挿入しています。それを除く。

代わりに、クライアント バンドルに管理対象リソースとして追加してください。

https://developers.google.com/web-toolkit/doc/latest/DevGuideClientBundle#Image_Sprites

于 2012-06-06T17:54:51.767 に答える