-
Ext User
background Image position
Hi everybody!
Please give me a hint.
This code create Imge in upper/left corner, but i want in right/down:
viewport = new Viewport();
viewport.setLayout( new FlowLayout() );
Image logoImage = new Image("images/logo.png");
viewport.add(logoImage, new MarginData(50));
RootPanel.get().add( viewport );
Thanks!
-
Ext GWT Premium Member
try another layout - maybe AnchorLayout
-
Ext User
gslender thanks for replay!
AnchorLayout is not suite. Its javadoc says:
"Child Widgets are:
Sized : Yes - relative to parent container
Positioned : No - child widgets will flow"
But i need vice versa.
Sory for my poor English.
-
Ext GWT Premium Member
did you try other layouts? like TableLayout where you can create a cell aligned right and bottom?
-
logoImage needs to be positioned absolute with right and bottom values set to 0
-
Ext User
-
Ext User
Just for fun 
use TableLayout, this code:
viewport = new Viewport();
// want has 1 row
TableLayout layout = new TableLayout(1);
layout.setCellHorizontalAlign( HorizontalAlignment.RIGHT );
layout.setCellVerticalAlign( VerticalAlignment.BOTTOM );
layout.setCellSpacing( 50 );
viewport.setLayout( layout );
Image logoImage = new Image("images/logo.png");
// and 1 cell
viewport.add(logoImage);
but Image rendered in the same place (UL corner)
Sven, i misunderstand you
AbsoluteLayout has no properties right, bottom
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules