tags:

views:

51

answers:

2

Hi,

I have created multiple items in a single panel. Now i want to display this panel in a 'fit' layout. I don't want to fix the height and width for this panel. I know 'fit' layout allows only one item to display.

Is it possible to use 'fit' layout here? Or Is there any alternative to achieve this?

Thanks, Anandan

+1  A: 

'fit' allows only one item, just like you say you know.

Without knowing excatly what you want to achieve, layout-wise, I'd say start playing with 'anchor', 'hbox', and 'vbox' -- it's quite likely one of those will do what you want.

timdev
Thanks. I will try the Vbox option
Anandan
+2  A: 

Fit gives you one item which fills the container entirely. So if you have multiple items and you are trying to use a fit, you must want multiple items to fit into the container entirely. You have 2 options

  1. You can use anchor, which allows you to specify exactly where each contained item sits, relative to the container. You can specify that the first item is at 0% from the left and 0% from the top; the second item can be 50% from the left, 0% from the top; the third can be 5px from the right, etc.

  2. You can use hbox or vbox and stack all contained items in a row or a column. The flex property of each contained item will give you some ability to set their width or height relative to the contained element.

It's not clear from the question what you are trying to make happen.

Jesse Dhillon
Thanks. I will try the Vbox option
Anandan