9 Replies Latest reply on Feb 14, 2010 1:50 AM by Shongrunden

    Spark list with tileLayout content height problems

    monkeymagiic Level 1

      Why hello clarice/adobe

       

       

      My first ever post on the Adobe forums dont really know if I should be professionala or let it all hand out.

       

      Problem: Currently building a Air application that requires multiple stacked lists in a vertical group, unfortunately I am plagued by a unnecessary large gap below each of these lists (only when using the TileLayout), as a temporary fix I extended Tilelayout and re-set the explicit height (http://www.tyroneneill.com/?p=34), this is probably not the ideal solution and maybe this is just some property I still have not found? although been digging through the class for hours.

       

      The Image attached shows the gaps between each list before my little fix was done.

       

      TileLayoutGapshow.png

        • 1. Re: Spark list with tileLayout content height problems
          rfrishbe Level 3

          Perhaps your item renderers are in fact bigger than you think?  If this was the case, then the item renderers would be given this extra height.  One quick test for this is to add an event listener for resize in the item renderer and ask for this.height, this.measuredHeight.  You could also try setting rowHeight on the TileLayout without having to create a TileLayout subclass.

           

          Hope that helps,

          Ryan

          • 2. Re: Spark list with tileLayout content height problems
            monkeymagiic Level 1

            Hi Ryan

             

            Thanks for the response,

             

            I did think this to start and tried all of the above though this is not the case, have you tried to replicate a vertically stacked components with lists?

             

            Also if you look at my shortcut quick fix:

             

            override public function measure():void
                      {
                           var layoutTarget:GroupBase = target;
                           layoutTarget.explicitHeight = Math.ceil(rowCount * (rowHeight + verticalGap) - verticalGap);
                           super.measure( );
                      }

             

            You will notice that I am actually using the rowHeight suggesting that it is not this that is causing the issue.

             

            Thanks

            • 3. Re: Spark list with tileLayout content height problems
              Shongrunden Adobe Employee

              @monkeymagiic - Can you attach a sample application that demonstrates this gap so we can take a closer look?

              • 4. Re: Spark list with tileLayout content height problems
                monkeymagiic Level 1

                I will try and get a sample application together this weekend, I may have a digg further into the code a bit myself, I was thinking about how I am attaching the data to the list and this might be of some value to solving it:

                 

                .I attach the dataProvider as VO

                .I then make the httpRequest

                .data is hydrated into the VO

                 

                I wonder if this is a problem with the data provider changing from 0 items to ~ items and the sizing gets a bit fuzzy? Ill do some testing in a static test and put the source up soon.

                 

                Cheers

                 

                The Monkey

                • 5. Re: Spark list with tileLayout content height problems
                  monkeymagiic Level 1

                  This bug is my evil nightmare, Unfortunately I have not got round to show you an example (been busy building my candy popping music application)

                   

                  TileLayout has a problem when displayed in it's default more (Row)

                   

                  I had a look at the following code:

                   

                   

                  override public function measure():void
                            {
                                 /*
                                 var layoutTarget:GroupBase = target;
                                 if (!layoutTarget)
                                      return;
                                 
                                 updateActualValues(layoutTarget.explicitWidth, layoutTarget.explicitHeight);
                                 
                                 var columnCount:int = columnCount != -1 ? Math.max(1, columnCount) : columnCount;
                                 var rowCount:int = _requestedRowCount != -1 ? Math.max(1, _requestedRowCount) : _rowCount;
                                 
                                 if (columnCount == 0)
                                      layoutTarget.measuredWidth = layoutTarget.measuredMinWidth = 0;
                                 else
                                 {
                                      layoutTarget.measuredWidth = Math.ceil(columnCount * (_columnWidth + _horizontalGap) - _horizontalGap);
                                      layoutTarget.measuredMinWidth = Math.ceil(_columnCount * (_columnWidth + _horizontalGap) - _horizontalGap);
                                 }
                                 
                                 if (rowCount == 0)
                                      layoutTarget.measuredHeight = layoutTarget.measuredMinHeight = 0;        
                                 else
                                 {
                                      layoutTarget.measuredHeight = Math.ceil(rowCount * (_rowHeight + _verticalGap) - _verticalGap);
                                      layoutTarget.measuredMinHeight = Math.ceil(_rowCount * (_rowHeight + _verticalGap) - _verticalGap);
                                 }
                                 */
                                 super.measure( );
                            }
                  

                   

                   

                  I decided to trace out the rowCount and it appears this is not the correct row count eg:

                   

                  I have 2 rows of items and the tileLayout assumes I have 5 rows, It is very odd.

                   

                  Since I am stacking these on top of each other it is very easy to notice the incorrect height, I thought I would post this before I get an example app together this weekend.

                  • 6. Re: Spark list with tileLayout content height problems
                    Flex harUI Adobe Employee

                    We know what our code looks like.  Post a small test case that uses that

                    code and ends up with the 5 rows instead of 2.

                    • 7. Re: Spark list with tileLayout content height problems
                      monkeymagiic Level 1

                      I apologise, I can see how that post was a bit out of order.

                       

                      onto the Example, finally put one together and by doing this also noticed what property causes it, It appears if I set the width to 100% it starts this funnyness.

                       

                      Anyhow attached.

                       

                      Many Thanks

                       

                      Tyrone (MonkeyMagiic)

                      • 8. Re: Spark list with tileLayout content height problems
                        monkeymagiic Level 1

                        Not sure if this helps but I have discovered that this occurs when the spark parent container's width is set to 100%

                        • 9. Re: Spark list with tileLayout content height problems
                          Shongrunden Adobe Employee

                          Thanks for attaching a project.  It looks like this boils down to a Scroller bug, I have filed it here:

                          http://bugs.adobe.com/jira/browse/SDK-25495

                          1 person found this helpful