0

弹出窗口是一个装饰性弹出窗口,其中的文本是一个标签,关闭是一个按钮。我已将标签和按钮添加到水平面板,然后将其添加到弹出面板。我已经尝试过 invalidEntryVpanel.setVerticalAlignment(HasVerticalAlignment.ALIGN_MIDDLE); invalidEntryVpanel.setHorizo​​ntalAlignment(HasHorizo​​ntalAlignment.ALIGN_CENTER);

但仍然无法将其对齐在中心请帮忙。提前致谢

4

1 回答 1

1

像这样试试

您必须在设置后添加小部件align center

VerticalPanel vpnPanel = new VerticalPanel();
        vpnPanel.add(scrollPanel);   //all controls added to scrill panel with help of set widget 
        vpnPanel.setHorizontalAlignment(HasHorizontalAlignment.ALIGN_CENTER);
        HorizontalPanel btnLayoutPanel = new HorizontalPanel();
        btnLayoutPanel.setSpacing(10);
        btnLayoutPanel.add(closeButton);
        vpnPanel.add(btnLayoutPanel);
        decPopuppanel.setWidget(vpnPanel);
于 2013-02-06T10:11:08.730 回答