Use uibinder css in java, not in xml
2 answers
You need to take the following steps to use styles in the view class:
- Define an interface that extends
CssResourcein the view class
interface Style extends CssResource {
String myStyle();
}
- Add the ui field of this type that you just defined in the view class
@UiField
Style style;
- In your ui.xml add an attribute
typeto the element<ui:style>(the type must match the interface of step 1):
<ui:style type="com.example.MyView.Style">
css, ,
Style(myStyle())Style(style.myStyle())
, .
+14