<?xml version="1.0" encoding="utf-8"?>
<s:VGroup xmlns:fx="http://ns.adobe.com/mxml/2009"
xmlns:s="library://ns.adobe.com/flex/spark"
width="300" height="300" horizontalAlign="center" verticalAlign="middle" xmlns:cc="cc.*">
<fx:Declarations>
</fx:Declarations>
<fx:Script>
<![CDATA[
import cc.SimpleRadioButtonRenderer;
import mx.collections.ArrayCollection;
[Bindable]public var mydataProvider : ArrayCollection = new ArrayCollection([
{label:'United States of America',data:0},
{label:'Alabama',data:1},
{label:'Alaska',data:2},
{label:'Arizona',data:3},
{label:'Arkansas',data:4},
{label:'California',data:5},
{label:'Colorado',data:6},
{label:'Connecticut',data:7},
{label:'Delaware',data:8},
{label:'Florida',data:9},
{label:'Georgia',data:10},
{label:'Hawaii',data:11},
{label:'Idaho',data:12},
{label:'Illinois',data:13},
{label:'Indiana',data:14},
{label:'Iowa',data:15},
{label:'Kansas',data:16},
{label:'Kentucky',data:17},
{label:'Louisiana',data:18},
{label:'Maine',data:19},
{label:'Maryland',data:20},
{label:'Massachusetts',data:21},
{label:'Michigan',data:22},
{label:'Minnesota',data:23},
{label:'Mississippi',data:24},
{label:'Missouri',data:25},
{label:'Montana',data:26},
{label:'Nebraska',data:27},
{label:'Nevada',data:28},
{label:'New Hampshire',data:29},
{label:'New Jersey',data:30},
{label:'New Mexico',data:31},
{label:'New York',data:32},
{label:'North Carolina',data:33},
{label:'North Dakota',data:3},
{label:'Ohio',data:35},
{label:'Oklahoma',data:36},
{label:'Oregon',data:37},
{label:'Pennsylvania',data:38},
{label:'Rhode Island',data:39},
{label:'South Carolina',data:40},
{label:'South Dakota',data:41},
{label:'Tennessee',data:42},
{label:'Texas',data:43},
{label:'Utah',data:44},
{label:'Vermont',data:45},
{label:'Virginia',data:46},
{label:'Washington',data:47},
{label:'West Virginia',data:48},
{label:'Wisconsin',data:49},
{label:'Wyoming',data:50},
]);
]]>
</fx:Script>
<s:List id="menulist" width="100%" height="100%" dataProvider="{this.mydataProvider}" >
<s:itemRenderer>
<fx:Component>
<s:RadioButton value="{data.label}"/>
</fx:Component>
</s:itemRenderer>
</s:List>
</s:VGroup>
我对这个新的 Spark 组件有很多问题。我要做的就是制作一个 MXML 自定义控件,该控件将弹出(从移动应用程序的视图中),因为没有弹出菜单列表或下拉组合(那里的那些非常丑陋)某些控制被轻敲。弹出窗口包含一个填充有单选按钮的列表。
我尝试使用 {data} 作为标签属性,但我不断收到错误“1120:访问未定义的属性数据”。
任何人都可以帮我解决这个问题吗?