在 Blackberry Playbook 的移动 Flex Hero 项目中使用 qnx.ui.picker.Picker [英] Using qnx.ui.picker.Picker in mobile Flex Hero project for Blackberry Playbook

查看:18
本文介绍了在 Blackberry Playbook 的移动 Flex Hero 项目中使用 qnx.ui.picker.Picker的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

一个选择器示例 用于在 ActionScript 项目中使用.它在模拟器中运行良好.

there is a Picker example for usage in an ActionScript project. It works well in simulator.

但是您如何在 Mobile Flex 项目(使用 Burrito Flash Builder)中使用该组件?

But how do you use that component in a Mobile Flex Project (with Burrito Flash Builder)?

如何将 qnx.ui.picker.Picker 添加到 一个 spark.components.View?

How do you add a qnx.ui.picker.Picker to a spark.components.View?

后者似乎期待一个mx.core.UIComponent,但前者是一个qnx.ui.core.UIComponent.

The latter seems to expect a mx.core.UIComponent, but the former is a qnx.ui.core.UIComponent.

我上面提到的 ActionScript 项目工作正常,因为选择器已添加到 Sprite.但是将它添加到 Mobile Flex 项目中的视图对我来说失败了.

The ActionScript project I've mentioned above works ok, because the Picker is added to the Sprite. But adding it to a View in a Mobile Flex project fails for me.

谢谢!亚历克斯

更新:

我今天找到了这个页面:http://corlan.org/2011/03/28/creating-playbook-apps-with-flex-and-qnx-ui-components/

I've found this page today: http://corlan.org/2011/03/28/creating-playbook-apps-with-flex-and-qnx-ui-components/

而且我还发现 QNX AIR 组件也适用于 Android,想知道在 Android 上使用它们是否合法?Playbook SDK 法律声明中未提及任何内容.

And also I've found out that the QNX AIR components work on Android as well, wonder if it is legal to use them there? Nothing is mentioned in Playbook SDK Legal Notice.

推荐答案

首先,您需要将 SDK 中的 swc 添加到您的 Flex 项目中:

First you need to add the swc from the SDK into your Flex Project:

右键单击项目并选择属性,在 Flex Build Path 下,添加一个 SWC 并浏览到 SDK....\Adobe Flash Builder Burrito\sdks\blackberry-tablet-sdk-0.9.3\frameworks\libs\qnx-screen\qnx-screen.swc

Right click the Project and select Properties, under Flex Build Path, add a SWC and browse to the SDK. ...\Adobe Flash Builder Burrito\sdks\blackberry-tablet-sdk-0.9.3\frameworks\libs\qnx-screen\qnx-screen.swc

在项目中拥有 swc 后,您可以在脚本标记中以编程方式创建实例,例如:

Once you have the swc in the project you can create instances programmatically in the script tag, eg:

import qnx.ui.picker.Picker;
var pick:Picker = new Picker();
var arr:Array = [{label: "day", data:0}, {label: "week", data:1}, {label: "month", data:2}];
pick.dataProvider = new DataProvider([new DataProvider(arr)]);
pick.selectedIndices = [0];
addChild(pick);

您可能需要先在视图中添加一个容器,例如添加一个 mx:UIComponent 元素,然后向其中添加选择器,例如

You may need to add a container to your view first, eg add a mx:UIComponent element and then add the picker to that, eg

<mx:UIComponent id="pickerContainer"/>

pickerContainer.addChild(pick);

这篇关于在 Blackberry Playbook 的移动 Flex Hero 项目中使用 qnx.ui.picker.Picker的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆