Flex 4中如何创建不可编辑NumericStepper的例子

By Minidxer | October 8, 2009

接下来的例子演示了Flex 4中如何通过NumericStepper的editable属性,创建不可编辑NumericStepper。

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


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

  1. <?xml version="1.0" encoding="utf-8"?>
  2. <s:Application name="Spark_NumericStepper_textInput_editable_test"
  3.         xmlns:fx="http://ns.adobe.com/mxml/2009"
  4.         xmlns:s="library://ns.adobe.com/flex/spark"
  5.         xmlns:mx="library://ns.adobe.com/flex/halo">
  6.  
  7.     <fx:Script>
  8.         <![CDATA[
  9.             private function init():void {
  10.                 numericStepper.textInput.editable = false;
  11.             }
  12.         ]]>
  13.     </fx:Script>
  14.  
  15.     <s:NumericStepper id="numericStepper"
  16.             minimum="0"
  17.             maximum="100"
  18.             horizontalCenter="0"
  19.             verticalCenter="0"
  20.             initialize="init();" />
  21.  
  22. </s:Application>
代码:Peter deHaan 翻译/整理/编译:中文Flex例子

Topics: Gumbo, NumericStepper | 1 Comment » | Tags: ,

Search Posts