Flex Gumbo中如何通过将SolidColorStroke对象设置到weight属性设置Line对象粗细的例子

By Minidxer | June 21, 2009

接下来的例子演示了Flex Gumbo中如何通过将SolidColorStroke对象设置到weight属性,设置Line对象粗细。

让我们先来看一下Demo可以点击这里察看源代码):


下面是完整代码(或点击这里察看):

Download: main.mxml
  1. <?xml version="1.0" encoding="utf-8"?>
  2. <Application name="Line_stroke_weight_test"
  3.         xmlns="http://ns.adobe.com/mxml/2009"
  4.         layout="vertical"
  5.         verticalAlign="middle"
  6.         backgroundColor="white">
  7.  
  8.     <ApplicationControlBar dock="true">
  9.         <Form styleName="plain">
  10.             <FormItem label="weight:">
  11.                 <HSlider id="slider"
  12.                         minimum="0"
  13.                         maximum="20"
  14.                         snapInterval="1"
  15.                         tickInterval="1"
  16.                         liveDragging="true" />
  17.             </FormItem>
  18.         </Form>
  19.     </ApplicationControlBar>
  20.  
  21.     <Graphic>
  22.         <Line width="300">
  23.             <stroke>
  24.                 <SolidColorStroke id="lineStroke"
  25.                         color="haloOrange"
  26.                         weight="{slider.value}" />
  27.             </stroke>
  28.         </Line>
  29.     </Graphic>
  30.  
  31. </Application>
代码:Peter deHaan 翻译/整理/编译:中文Flex例子

Topics: Gumbo, Line | 2 Comments » | Tags: , , , ,

你可能还对下列文章感兴趣:

2 comments | Add One

  1. smallghost - 07/9/2009 at 6:42 am

    提示错误:
    Could not resolve to a component implementation.
    怎么解决? 我用的Flex版本是:flex_sdk_4.0.0.7219。
    谢谢!

  2. Minidxer - 07/10/2009 at 9:33 pm

    一般这个错误是SDK不兼容或者标签不被支持了。奇怪,我测试了6898之前的几个版本都可以的。

Leave a Comment

Name(*):

E-Mail(*) :

Website :

Comments :

Search Posts