Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
Clear All
new posts

    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

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

    Comment


      #3
      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

      Comment


        #4
        Any way I found workaround that I'm using setLayoutLeftMargin

        thanks for your help

        -raghu

        Comment


          #5
          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.

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

          Comment

          Working...
          X