문제

the pop up is a decorative pop up , the text in it is a label and close is a button. i have added the label and a button to horizontal panel and then added it to popup panel. i have tried with both invalidEntryVpanel.setVerticalAlignment(HasVerticalAlignment.ALIGN_MIDDLE); invalidEntryVpanel.setHorizontalAlignment(HasHorizontalAlignment.ALIGN_CENTER);

but still not able to align it in center please help. thanks in advance

도움이 되었습니까?

해결책

Try like this

You have to add the widgets after you set the 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);
라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top