1

I'm trying to create the following layout for a mobile/tablet application using GWT + MGWT. I want the central widget to stay centred horizontally and vertically, but for the logo and lower text to fill up the remaining space.

Mobile/Tablet layout

This seems like it should be such a simple thing, but I just can't get it to work! Any help would be greatly appreciated.

Cheers,

Jon

DeadPassive
  • 797
  • 3
  • 7
  • 22

1 Answers1

3

did you try with a VerticalPanel ?

VerticalPanel   vp = new VerticalPanel();

logo = new Label( "" );
vp.add( logo );
vp.setCellHorizontalAlignment(  logo , HasHorizontalAlignment.ALIGN_CENTER) ;
vp.setCellVerticalAlignment(    logo , HasVerticalAlignment.ALIGN_MIDDLE) ;

 ... 
 and so on for others.
Overnuts
  • 753
  • 5
  • 16
  • Hi Overnuts, thanks for the response. I haven't tried it exactly like that, no. Are you supposed to set the alignment before or after adding it to the panel? You seem to have done both :-) – DeadPassive Jun 12 '12 at 09:21
  • in a first time, add it to the panel, and then set alignments ! – Overnuts Jun 12 '12 at 11:14
  • Thanks! My problem was that I was trying to do with within an MGWT ScrollPanel widget, which really doesn't work as expected. Your suggestion works fine in a normal situation though. – DeadPassive Jun 12 '12 at 12:35