2017-04-22 75 views

回答

0

不是最好的方式,但它的工作原理:在

运行时
<b:PanelBody ui:field="test"> 
    <b:Button ui:field="buttonTest"> 
    s 
    </b:Button> 
    <b:Image type="THUMBNAIL" url="https://cdn2.iconfinder.com/data/icons/drf/PNG/color.png" ui:field="img1"/> 
    <b:Image type="THUMBNAIL" url="http://codeissue.com/images/check_icon_small.png" ui:field="img2"/> 
</b:PanelBody> 

decleration: 
    @UiField Button buttonTest; 
    @UiField Image img1; 
    @UiField Image img2; 
    @UiField PanelBody test; 

In the constructor: 
    test.setStyleName("fa-stack fa-lg"); 
    img1.setStyleName("fa fa-stack-2x"); 
    buttonTest.setStyleName("fa fa-stack-2x"); 
    img2.setStyleName("fa fa-stack-1x"); 

结果: result