Using qnx.ui.picker.Picker in mobile Flex Hero project for Blackberry Playbook

一笑奈何 提交于 2019-11-28 01:45:46

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

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

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);

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);

As I understand, right now we can't use UI components in Flex Mobile project. You can go to: Project - Properties - Flex Build Packaging - BlackBerry Tablet OS and check Include BlackBerry tablet OS libraries in build path, but, you'll get an error:

"Design mode could not load qnx-air.swc. It may be incompatible with this SDK, or invalid. (DesignAssetLoader.CompleteTimeout)"

BlackBerry guys says that it'll be fixed in future release. So right now you can use QNX components only in ActionScript.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!