Flex 中的 QNX 列表根本不显示!

发布于 2024-11-24 14:54:27 字数 2117 浏览 1 评论 0原文

我在 Flex (Adobe AIR) 中遇到了一个奇怪的 QNX 问题,我创建了一个 init();函数,并在其中添加了 test_list() 函数,但 QNX 列表并未显示在 UI 上。请参阅下面的代码了解摘要,并参阅下面的链接了解完整代码:

http://pastebin.com/hkzTwSGE

概括

        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:

http://pastebin.com/hkzTwSGE

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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

心的憧憬 2024-12-01 14:54:27

您需要将任何 QNX 组件添加到包装器中。正如这里所见:
http://corlan. org/2011/03/28/creating-playbook-apps-with-flex-and-qnx-ui-components/

因此,您需要将其添加到动作脚本中:

// this.addChild(myList);
dateWrapper.addChild(myList);

并将其添加到 MXML

<mx:UIComponent id="dateWrapper"/>

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:

// this.addChild(myList);
dateWrapper.addChild(myList);

and this to the MXML

<mx:UIComponent id="dateWrapper"/>
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文