You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@flex.apache.org by Frank Dahmen <fr...@dahmenia.de> on 2014/07/03 09:47:51 UTC

TileGroup grows unnecessary

Hi,

I have a tilegroup where i add icons (spark images) at runtime.
There is enough room for 4 icons in one row of the tilegroup,
but when adding the third icon the group grows as for making room for 
the next row,
although the third icon is placed in the first row (the 4th also)
the same is for the 2nd row and the 7th icon and so on
here some high tech graphics to show what i mean ;)

2 icons (right):
-----------------------------
icon  icon
-----------------------------


3 icons (wrong):
----------------------------
icon icon icon


----------------------------


should be:
---------------------------
icon icon icon
---------------------------


what I'm doing wrong?
thanks
Frank

Re: TileGroup grows unnecessary

Posted by Frank Dahmen <fr...@dahmenia.de>.
setting height to 100% and validateNow() does not help
yes, i could compute the height each time the user adds an icon
but i thought its a misconfiguration of the tilegroup or even a bug

i just found out that when i set the width of the tilegroup to a real value
(the measured width of the screen in the mobile view) and not to 100%
then it works








Am 03.07.2014 18:13, schrieb mark goldin:
> If nothing else you can try using this function called after you have done
> adding controls:
>
> ...
> validateNow();
> resizeTileGroup();
>
> private function resizeTileGroup():void
> {
> var maxH:int = 0;
> for (var i:int=1;i<=rowCount;i++)
> {
> var elt:DisplayObject = getChildAt(i * columnCount - columnCount);
> maxH += elt.height;
> }
> height = maxH + verticalGap * rowCount;
> }
>
>
> On Thu, Jul 3, 2014 at 11:05 AM, mark goldin <ma...@gmail.com> wrote:
>
>> Try setting up height as well. Also see if validateNow() after you finish
>> adding images at the run time has any effect.
>>
>>
>> On Thu, Jul 3, 2014 at 11:03 AM, Frank Dahmen <fr...@dahmenia.de> wrote:
>>
>>> width is 100%,  height has no value, it shall grow in height but only
>>> when needed (5 icons, 9 icons etc.)
>>>
>>>
>>> Am 03.07.2014 16:55, schrieb mark goldin:
>>>
>>>   Have you set width and height of the control to percentage values?
>>>>
>>>> On Thu, Jul 3, 2014 at 2:47 AM, Frank Dahmen <fr...@dahmenia.de> wrote:
>>>>
>>>>   Hi,
>>>>> I have a tilegroup where i add icons (spark images) at runtime.
>>>>> There is enough room for 4 icons in one row of the tilegroup,
>>>>> but when adding the third icon the group grows as for making room for
>>>>> the
>>>>> next row,
>>>>> although the third icon is placed in the first row (the 4th also)
>>>>> the same is for the 2nd row and the 7th icon and so on
>>>>> here some high tech graphics to show what i mean ;)
>>>>>
>>>>> 2 icons (right):
>>>>> -----------------------------
>>>>> icon  icon
>>>>> -----------------------------
>>>>>
>>>>>
>>>>> 3 icons (wrong):
>>>>> ----------------------------
>>>>> icon icon icon
>>>>>
>>>>>
>>>>> ----------------------------
>>>>>
>>>>>
>>>>> should be:
>>>>> ---------------------------
>>>>> icon icon icon
>>>>> ---------------------------
>>>>>
>>>>>
>>>>> what I'm doing wrong?
>>>>> thanks
>>>>> Frank
>>>>>
>>>>>


Re: TileGroup grows unnecessary

Posted by mark goldin <ma...@gmail.com>.
If nothing else you can try using this function called after you have done
adding controls:

...
validateNow();
resizeTileGroup();

private function resizeTileGroup():void
{
var maxH:int = 0;
for (var i:int=1;i<=rowCount;i++)
{
var elt:DisplayObject = getChildAt(i * columnCount - columnCount);
maxH += elt.height;
}
height = maxH + verticalGap * rowCount;
}


On Thu, Jul 3, 2014 at 11:05 AM, mark goldin <ma...@gmail.com> wrote:

> Try setting up height as well. Also see if validateNow() after you finish
> adding images at the run time has any effect.
>
>
> On Thu, Jul 3, 2014 at 11:03 AM, Frank Dahmen <fr...@dahmenia.de> wrote:
>
>> width is 100%,  height has no value, it shall grow in height but only
>> when needed (5 icons, 9 icons etc.)
>>
>>
>> Am 03.07.2014 16:55, schrieb mark goldin:
>>
>>  Have you set width and height of the control to percentage values?
>>>
>>>
>>> On Thu, Jul 3, 2014 at 2:47 AM, Frank Dahmen <fr...@dahmenia.de> wrote:
>>>
>>>  Hi,
>>>>
>>>> I have a tilegroup where i add icons (spark images) at runtime.
>>>> There is enough room for 4 icons in one row of the tilegroup,
>>>> but when adding the third icon the group grows as for making room for
>>>> the
>>>> next row,
>>>> although the third icon is placed in the first row (the 4th also)
>>>> the same is for the 2nd row and the 7th icon and so on
>>>> here some high tech graphics to show what i mean ;)
>>>>
>>>> 2 icons (right):
>>>> -----------------------------
>>>> icon  icon
>>>> -----------------------------
>>>>
>>>>
>>>> 3 icons (wrong):
>>>> ----------------------------
>>>> icon icon icon
>>>>
>>>>
>>>> ----------------------------
>>>>
>>>>
>>>> should be:
>>>> ---------------------------
>>>> icon icon icon
>>>> ---------------------------
>>>>
>>>>
>>>> what I'm doing wrong?
>>>> thanks
>>>> Frank
>>>>
>>>>
>>
>

Re: TileGroup grows unnecessary

Posted by mark goldin <ma...@gmail.com>.
Try setting up height as well. Also see if validateNow() after you finish
adding images at the run time has any effect.


On Thu, Jul 3, 2014 at 11:03 AM, Frank Dahmen <fr...@dahmenia.de> wrote:

> width is 100%,  height has no value, it shall grow in height but only when
> needed (5 icons, 9 icons etc.)
>
>
> Am 03.07.2014 16:55, schrieb mark goldin:
>
>  Have you set width and height of the control to percentage values?
>>
>>
>> On Thu, Jul 3, 2014 at 2:47 AM, Frank Dahmen <fr...@dahmenia.de> wrote:
>>
>>  Hi,
>>>
>>> I have a tilegroup where i add icons (spark images) at runtime.
>>> There is enough room for 4 icons in one row of the tilegroup,
>>> but when adding the third icon the group grows as for making room for the
>>> next row,
>>> although the third icon is placed in the first row (the 4th also)
>>> the same is for the 2nd row and the 7th icon and so on
>>> here some high tech graphics to show what i mean ;)
>>>
>>> 2 icons (right):
>>> -----------------------------
>>> icon  icon
>>> -----------------------------
>>>
>>>
>>> 3 icons (wrong):
>>> ----------------------------
>>> icon icon icon
>>>
>>>
>>> ----------------------------
>>>
>>>
>>> should be:
>>> ---------------------------
>>> icon icon icon
>>> ---------------------------
>>>
>>>
>>> what I'm doing wrong?
>>> thanks
>>> Frank
>>>
>>>
>

Re: TileGroup grows unnecessary

Posted by Frank Dahmen <fr...@dahmenia.de>.
width is 100%,  height has no value, it shall grow in height but only 
when needed (5 icons, 9 icons etc.)


Am 03.07.2014 16:55, schrieb mark goldin:
> Have you set width and height of the control to percentage values?
>
>
> On Thu, Jul 3, 2014 at 2:47 AM, Frank Dahmen <fr...@dahmenia.de> wrote:
>
>> Hi,
>>
>> I have a tilegroup where i add icons (spark images) at runtime.
>> There is enough room for 4 icons in one row of the tilegroup,
>> but when adding the third icon the group grows as for making room for the
>> next row,
>> although the third icon is placed in the first row (the 4th also)
>> the same is for the 2nd row and the 7th icon and so on
>> here some high tech graphics to show what i mean ;)
>>
>> 2 icons (right):
>> -----------------------------
>> icon  icon
>> -----------------------------
>>
>>
>> 3 icons (wrong):
>> ----------------------------
>> icon icon icon
>>
>>
>> ----------------------------
>>
>>
>> should be:
>> ---------------------------
>> icon icon icon
>> ---------------------------
>>
>>
>> what I'm doing wrong?
>> thanks
>> Frank
>>


Re: TileGroup grows unnecessary

Posted by mark goldin <ma...@gmail.com>.
Have you set width and height of the control to percentage values?


On Thu, Jul 3, 2014 at 2:47 AM, Frank Dahmen <fr...@dahmenia.de> wrote:

> Hi,
>
> I have a tilegroup where i add icons (spark images) at runtime.
> There is enough room for 4 icons in one row of the tilegroup,
> but when adding the third icon the group grows as for making room for the
> next row,
> although the third icon is placed in the first row (the 4th also)
> the same is for the 2nd row and the 7th icon and so on
> here some high tech graphics to show what i mean ;)
>
> 2 icons (right):
> -----------------------------
> icon  icon
> -----------------------------
>
>
> 3 icons (wrong):
> ----------------------------
> icon icon icon
>
>
> ----------------------------
>
>
> should be:
> ---------------------------
> icon icon icon
> ---------------------------
>
>
> what I'm doing wrong?
> thanks
> Frank
>