GWT의 CssResource에 약간의 문제가 있습니다. 나는 AbsolutePanel과 label의 스타일을 바꾸고 싶지만 실행은하지 않습니다. setStyleName 메서드로 스타일 클래스를 추가해도 아무 일도 일어나지 않습니다. 이 코드 조각에서 GWT - CssResource가 실행되지 않습니다.
나는 자원 사용이 확장 내 인터페이스는public CustommerView() {
MyResource cssResource = GWT.create(MyResource.class);
MyCss myCss = cssResource.css();
AbsolutePanel basePanel = new AbsolutePanel();
initWidget(basePanel);
basePanel.setStyleName(myCss.rootPanel());
Label label = new Label();
label.setText("Im label");
label.setStyleName(myCss.label());
basePanel.add(label);
}
입니다 CssResource :
public interface MyCss extends CssResource {
/**
* Method for return command button class name
* @return command button class name
*/
public String rootPanel();
public String label();
}
이 파일 시스템에 MyCss 인터페이스 옆에 내 CSS 파일입니다 :
.rootPanel {
position:absolute !important;
top:0px;
left:0px;
background-color:yellow !important;
height: 20px !important;
width: 18px !important;
}
.label {
color:red;
}
커스텀보기는 GWT Composite입니다. 내가보기로 이동하고 싶을 때, 나는 단순히 RootPanel.get ("mainArea")를 호출합니다. 발표자의 add (view.asWidget). mainArea는 div 요소입니다.
내가 웹 inf에서 CSS 파일에 CSS 클래스를 붙여 넣으면 모든 것이 정상적으로 실행됩니다. 누군가가 나에게이 문제를 해결하는 방법을 알려줄 수 있습니까? 감사.
[CssResource에 정의 된 CSS 관련 문제] (0120-337-385) –