Flex – 使用 Scroller 替 Container 加上 Scroll Bar

在 Flex 4 上如需替 Container 加上 Scroll Bar 時需使用 Scroller Library 來達至此功能.
   1:  <s:NavigatorContent label="Accordion Button for Panel 1" width="100%" height="100%">
   2:      <s:Scroller width="100%" height="100%">
   3:          <s:Group>
   4:              <s:layout>
   5:                  <s:VerticalLayout gap="0" paddingLeft="5" paddingTop="5" />
   6:              </s:layout>
   7:              <s:Label text="Accordion container panel 1"/>
   8:              <s:Label text="Accordion container panel 1"/>
   9:              <s:Label text="Accordion container panel 1"/>
  10:              <s:Label text="Accordion container panel 1"/>
  11:              <s:Label text="Accordion container panel 1"/>
  12:              <s:Label text="Accordion container panel 1"/>
  13:              <s:Label text="Accordion container panel 1"/>
  14:              <s:Label text="Accordion container panel 1"/>
  15:              <s:Label text="Accordion container panel 1"/>
  16:              <s:Label text="Accordion container panel 1"/>
  17:              <s:Label text="Accordion container panel 1"/>
  18:              <s:Label text="Accordion container panel 1"/>
  19:              <s:Label text="Accordion container panel 1"/>
  20:              <s:Label text="Accordion container panel 1"/>
  21:              <s:Label text="Accordion container panel 1"/>
  22:          </s:Group>                        
  23:      </s:Scroller>
  24:  </s:NavigatorContent>
在所需的 Container 之外加上 Scroller 把 Container 給包起來就可以達到此效果.

image

留言

這個網誌中的熱門文章

WPF - 深入 Style

C# – M$ Chart Control 自定 ToolTip 的顯示

Vue.js - 基礎介紹教學