I'm trying to set the background of Window with an image. The image I'm setting does not fit or scale to the size of the background. The image does not fill the entire background ...
After doing some research, I came to know that there is an advanced CSS property viz. background-size:cover for which SmartGWT (V4.0) does not have the API to set it. Are there any alternatives to that approach ?
Here is my code.
Any help is appreciated. Thanks.
After doing some research, I came to know that there is an advanced CSS property viz. background-size:cover for which SmartGWT (V4.0) does not have the API to set it. Are there any alternatives to that approach ?
Here is my code.
Any help is appreciated. Thanks.
Code:
Window greetingWindow = new Window(); greetingWindow.setWidth100(); greetingWindow.setHeight("90%"); greetingWindow.setShowMinimizeButton(false); greetingWindow.setShowMaximizeButton(false); greetingWindow.setShowCloseButton(false); greetingWindow.setShowModalMask(true); greetingWindow.setIsModal(true); greetingWindow.setAutoSize(false); greetingWindow.setAlign(VerticalAlignment.CENTER); greetingWindow.setCanDragResize(true); greetingWindow.setDismissOnOutsideClick(true); greetingWindow.setShowHeader(false); greetingWindow.centerInPage(); HLayout hLayout = new HLayout(); hLayout.setHeight100(); hLayout.setWidth100(); hLayout.setBackgroundImage("greetingbg.png"); hLayout.setBackgroundRepeat(BackgroundRepeat.NO_REPEAT); hLayout.setBackgroundPosition("left top"); greetingWindow.addItem(hLayout); Label label = new Label("HELO"); label.setAlign(Alignment.CENTER); label.setWidth100(); hLayout.addMember(label); hLayout.setAlign(VerticalAlignment.CENTER); greetingWindow.show();
Comment