Flex 中的 QNX 列表根本不显示!
我在 Flex (Adobe AIR) 中遇到了一个奇怪的 QNX 问题,我创建了一个 init();函数,并在其中添加了 test_list() 函数,但 QNX 列表并未显示在 UI 上。请参阅下面的代码了解摘要,并参阅下面的链接了解完整代码:
概括
private function init() : void {
credentials = String(data);
var arr:Array = new Array();
arr.push("item 1");
arr.push("item 2");
indexArrayCollection = new ArrayCollection();
subsonicIndexList = new DataProvider(arr);
//subsonicIndexList = new DataProvider(indexArrayCollection.source);
//get_indexList(null);
test_list();
}
private function test_list() : void {
var arrMonth:Array=[];
// add objects with a label property
arrMonth.push({label: "January"});
arrMonth.push({label: "February"});
arrMonth.push({label: "March"});
arrMonth.push({label: "April"});
arrMonth.push({label: "May"});
arrMonth.push({label: "June"});
arrMonth.push({label: "July"});
arrMonth.push({label: "August"});
arrMonth.push({label: "September"});
arrMonth.push({label: "October"});
arrMonth.push({label: "November"});
arrMonth.push({label: "December"});
var myList:List = new List();
myList.setPosition(100, 100);
myList.width = 300;
myList.height = 400;
myList.columnWidth = 100;
//set the dataProvider
myList.selectionMode = ListSelectionMode.MULTIPLE;
myList.scrollDirection = ScrollDirection.VERTICAL;
myList.dataProvider = new DataProvider(arrMonth);
myList.addEventListener(ListEvent.ITEM_CLICKED, showAlert);
myList.addEventListener(ScrollEvent.SCROLL_END, showAlert);
myList.addEventListener(ScrollEvent.SCROLL_BEGIN, showAlert);
this.addChild(myList);
}
I am having a strange QNX problem here in Flex (Adobe AIR), I have created an init(); function and in it I have added the test_list() function yet the QNX List is just not showing up on the UI. Please see code below for a summary and the link below for a FULL code:
Summary
private function init() : void {
credentials = String(data);
var arr:Array = new Array();
arr.push("item 1");
arr.push("item 2");
indexArrayCollection = new ArrayCollection();
subsonicIndexList = new DataProvider(arr);
//subsonicIndexList = new DataProvider(indexArrayCollection.source);
//get_indexList(null);
test_list();
}
private function test_list() : void {
var arrMonth:Array=[];
// add objects with a label property
arrMonth.push({label: "January"});
arrMonth.push({label: "February"});
arrMonth.push({label: "March"});
arrMonth.push({label: "April"});
arrMonth.push({label: "May"});
arrMonth.push({label: "June"});
arrMonth.push({label: "July"});
arrMonth.push({label: "August"});
arrMonth.push({label: "September"});
arrMonth.push({label: "October"});
arrMonth.push({label: "November"});
arrMonth.push({label: "December"});
var myList:List = new List();
myList.setPosition(100, 100);
myList.width = 300;
myList.height = 400;
myList.columnWidth = 100;
//set the dataProvider
myList.selectionMode = ListSelectionMode.MULTIPLE;
myList.scrollDirection = ScrollDirection.VERTICAL;
myList.dataProvider = new DataProvider(arrMonth);
myList.addEventListener(ListEvent.ITEM_CLICKED, showAlert);
myList.addEventListener(ScrollEvent.SCROLL_END, showAlert);
myList.addEventListener(ScrollEvent.SCROLL_BEGIN, showAlert);
this.addChild(myList);
}
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您需要将任何 QNX 组件添加到包装器中。正如这里所见:
http://corlan. org/2011/03/28/creating-playbook-apps-with-flex-and-qnx-ui-components/
因此,您需要将其添加到动作脚本中:
并将其添加到 MXML
You need to add any QNX components to a wrapper. As seen here:
http://corlan.org/2011/03/28/creating-playbook-apps-with-flex-and-qnx-ui-components/
So you would need to this to the actionscript:
and this to the MXML