2 Replies Latest reply on Apr 5, 2010 7:07 AM by sleblang

    SparkDataContainer Scroller not scrolling to bottom of container

    sleblang Level 1

      I am using a scroller component within a custom skin for a SkinnableDataContainer. I am running into an issue in that the thumbbar of the scroller stops at about the 50% point, however this is actually the end of the scrollable area. In actuality, the thumbbar should be at the bottom of the scroll track. Here's the code for the scroller:

       

       

      <s:SparkSkin xmlns:fx="http://ns.adobe.com/mxml/2009"
                      xmlns:s="library://ns.adobe.com/flex/spark"
                      xmlns:mx="library://ns.adobe.com/flex/halo" bottom="150"  >
           
           <!-- Properties of the parent ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -->
           
           <s:states>
                <s:State name="normal" />
                <s:State name="disabled" />
           </s:states>     
           
           
           <!-- Metadata ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -->     
           
           <fx:Metadata>
                [HostComponent("spark.components.SkinnableDataContainer")]
           </fx:Metadata>     
      
           
           <!-- UI components ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -->
           
           <s:Rect left="0" right="0" 
                     bottom="0" top="0"
                     radiusX="4" radiusY="4"   >
                <s:fill>
                     <s:SolidColor id="fillColor" color="0xEFEFEF"/>
                </s:fill>
           </s:Rect>     
           
           <s:Group width="905" height="395" id="mainGroup">
                <s:Scroller left="10" right="10" top="4" bottom="10" >
                          <s:DataGroup id="dataGroup" />                    
      
                </s:Scroller>
                <s:Rect left="0" right="0" top="0" bottom="0">
                     <s:stroke>
                          <s:SolidColorStroke weight="1" color="0xD8D8D8"/>
                     </s:stroke>
                </s:Rect>
           </s:Group>
           
      </s:SparkSkin>
      
        • 1. Re: SparkDataContainer Scroller not scrolling to bottom of container
          Shongrunden Adobe Employee

          Can you please post a small sample application that demonstrates this?  I was unable to reproduce it using the skin you posted above with this small sample application:

          <s:Application xmlns:fx="http://ns.adobe.com/mxml/2009"
                         xmlns:s="library://ns.adobe.com/flex/spark">
              <fx:Script>
                  <![CDATA[
                      import mx.collections.ArrayList;
                      private function getArray(n:int = 100):ArrayList {
                          var arr:Array = new Array(n);
                          for (var i:int = 0; i < n; i++){
                              arr[i] = i;   
                          }
                          return new ArrayList(arr);
                      }
                  ]]>
              </fx:Script>
             
              <s:SkinnableDataContainer itemRenderer="spark.skins.spark.DefaultItemRenderer"
                                        dataProvider="{getArray()}"
                                        skinClass="CustomDataContainerSkin">
                  <s:layout>
                      <s:VerticalLayout />
                  </s:layout>
              </s:SkinnableDataContainer>
             
          </s:Application>
          • 2. Re: SparkDataContainer Scroller not scrolling to bottom of container
            sleblang Level 1

            This issue is related to this thread:

             

            http://forums.adobe.com/thread/608972?tstart=0

             

            I filed a bug report. Thanks for the assistance.