Flex中如何利用rowCount属性,使List控件Resize时特定的行被显示

<iframe src="http://blog.minidx.com/ext05/resizing-a-flex-list-control-using-the-rowcount-property/main.html" width="550" height="380"></iframe>

  1. <?xml version="1.0" encoding="utf-8"?>
  2. <mx:Applicationxmlns:mx="http://www.adobe.com/2006/mxml"
  3. layout="vertical"
  4. verticalAlign="middle"
  5. backgroundColor="white">
  6. <mx:XMLid="mlbXML" >
  7. <teams>
  8. <leagueid="AL">
  9. <teamlabel="Baltimore Orioles" />
  10. <teamlabel="Boston Red Sox" />
  11. <teamlabel="Chicago White Sox" />
  12. <teamlabel="Cleveland Indians" />
  13. <teamlabel="Detroit Tigers" />
  14. <teamlabel="Kansas City Royals" />
  15. <teamlabel="Los Angeles Angels of Anaheim" />
  16. <teamlabel="Minnesota Twins" />
  17. <teamlabel="New York Yankees" />
  18. <teamlabel="Oakland Athletics" />
  19. <teamlabel="Seattle Mariners" />
  20. <teamlabel="Tampa Bay Devil Rays" />
  21. <teamlabel="Texas Rangers" />
  22. <teamlabel="Toronto Blue Jays" />
  23. </league>
  24. </teams>
  25. </mx:XML>
  26. <mx:XMLListCollectionid="alTeams"
  27. source="{mlbXML.league.(@id == 'AL').team}"/>
  28. <mx:ApplicationControlBardock="true">
  29. <mx:Form>
  30. <mx:FormItemlabel="rowCount:">
  31. <mx:HSliderid="slider"
  32. minimum="1"
  33. maximum="10"
  34. snapInterval="1"
  35. liveDragging="true"
  36. dataTipPrecision="0"
  37. change="list.rowCount = event.value;"/>
  38. </mx:FormItem>
  39. </mx:Form>
  40. </mx:ApplicationControlBar>
  41. <mx:VBoxid="vBox" height="100%">
  42. <mx:Listid="list"
  43. maxHeight="{vBox.height}"
  44. dataProvider="{alTeams}"
  45. labelField="@label"/>
  46. </mx:VBox>
  47. </mx:Application>

你可能感兴趣的:(html,xml,Blog,Flex,Adobe)