GWT FocusPanel setProperty(“left”,xx“)不起作用

时间:2016-12-30 06:37:14

标签: gwt drag

我正在实施“拖动”应用“set left”。

以下是我的代码:

scrollPanel.setWidget(focusPanel);//add a focusPanel to the existing scrollPanel
focusPanel.setWidget(flowPanel); //add a flowPanelto the existing focusPanel
flowPanel.add(image) // add a image to  the flowPanel

scrollPanel.setPixelSize(scrollPanle_width,scrollPanle_height) focusPanel.setPixelSize(image_width,image__height)

放大图像,使图像尺寸大于scrollPanel尺寸

尝试拖动要在scrollPanel内查看的图像,

(1)工作方式

flowPanel.getElement().getStyle().setPropertyPx("left",  offset );

拖动时,可以移动图像。

(2)不工作

focusPanel.getElement().getStyle().setPropertyPx("left",  offset );

拖动时,无法移动图像。 也尝试这个,没有运气     小部件focusPanelWidget = scrollPanel.getWidget();     focusPanelWidget.getElement()。getStyle()。setPropertyPx(“left”,offset);

所以任何人都可以帮忙看看为什么“set left”对focusPanel不起作用? 感谢任何帮助!

非常感谢!

0 个答案:

没有答案
相关问题