VLayout Alignment is not working.

Hi

I’m trying to apply alignment as center to VLayout . but it’s not getting applied.

VLayout centerPage=new VLayout();
centerPage.setAlign(Alignment.CENTER);

Even I set the alignment to center, the widgets are getting added to the left side of the layout. plz help me.

-raghu

What is your VLayout width? Try calling setMemberLayout() on the widgets to CENTER.

I’m not able see any method with ‘setMemberLayout’ signature in VLayout API, plz suggest.

http://www.smartclient.com/smartgwtee/javadoc/com/smartgwt/client/widgets/layout/VLayout.html

-raghu

Any way I found workaround that I’m using setLayoutLeftMargin

thanks for your help

-raghu

Sorry wasn’t clear and wrong function, I mean’t not for the VLayout, but for the widgets being added to the VLayout set their alignment. Simple example would be.

VLayout l = new VLayout();
l.setWidth(500);
Label b = new Label();
b.setContents("Hello World");
b.setAlign(Alignment.CENTER);
l.addMember(b);
l.draw();