无法在 Blackberry 应用程序中创建文本输入

Posted

技术标签:

【中文标题】无法在 Blackberry 应用程序中创建文本输入【英文标题】:Can't create a text input in Blackberry apps 【发布时间】:2012-02-08 18:35:04 【问题描述】:

当我尝试在 BB Playbook 上运行显示 Cannot create property editable on qnx.fuse.ui.text.StageTextInput 的应用程序时,我不断收到错误消息。完全相同的代码在 android 和内置模拟器的 Flash Builder 上运行良好,但在物理 Playbook 和 Blackberry Playbook 模拟器中出错。似乎导致错误的代码区域如下:

<s:VGroup includeIn="login" top="10" left="10" right="10" id="loginForm">
    <s:Label text="Email" />
    <s:TextInput id="txt_email"  softKeyboardType="email" />
    <s:Label text="Password" />
    <s:TextInput id="txt_password"  displayAsPassword="true" />
    <s:Button id="btn_login" label="Login" click="authenticate()" fontWeight="normal"/>
</s:VGroup>

还有堆栈跟踪:

ReferenceError: Error #1056: Cannot create property editable on qnx.fuse.ui.text.StageTextInput.
    at flash.text::StageText/init()
    at flash.text::StageText()
    at StageTextPool$/acquireStageText()[E:\dev\4.y\frameworks\projects\mobilecomponents\src\spark\components\supportClasses\StyleableStageText.as:3072]
    at spark.components.supportClasses::StyleableStageText/http://www.adobe.com/2006/flex/mx/internal::getStageText()[E:\dev\4.y\frameworks\projects\mobilecomponents\src\spark\components\supportClasses\StyleableStageText.as:2415]
    at spark.components.supportClasses::StyleableStageText()[E:\dev\4.y\frameworks\projects\mobilecomponents\src\spark\components\supportClasses\StyleableStageText.as:403]
    at spark.skins.mobile.supportClasses::StageTextSkinBase/createChildren()[E:\dev\4.y\frameworks\projects\mobiletheme\src\spark\skins\mobile\supportClasses\StageTextSkinBase.as:185]
    at mx.core::UIComponent/initialize()[E:\dev\4.y\frameworks\projects\framework\src\mx\core\UIComponent.as:7634]
    at mx.core::UIComponent/http://www.adobe.com/2006/flex/mx/internal::childAdded()[E:\dev\4.y\frameworks\projects\framework\src\mx\core\UIComponent.as:7495]
    at mx.core::UIComponent/addChild()[E:\dev\4.y\frameworks\projects\framework\src\mx\core\UIComponent.as:7176]
    at spark.components.supportClasses::SkinnableComponent/attachSkin()[E:\dev\4.y\frameworks\projects\spark\src\spark\components\supportClasses\SkinnableComponent.as:692]
    at spark.components.supportClasses::SkinnableComponent/validateSkinChange()[E:\dev\4.y\frameworks\projects\spark\src\spark\components\supportClasses\SkinnableComponent.as:443]
    at spark.components.supportClasses::SkinnableComponent/createChildren()[E:\dev\4.y\frameworks\projects\spark\src\spark\components\supportClasses\SkinnableComponent.as:406]
    at mx.core::UIComponent/initialize()[E:\dev\4.y\frameworks\projects\framework\src\mx\core\UIComponent.as:7634]
    at mx.core::UIComponent/http://www.adobe.com/2006/flex/mx/internal::childAdded()[E:\dev\4.y\frameworks\projects\framework\src\mx\core\UIComponent.as:7495]
    at mx.core::UIComponent/addChildAt()[E:\dev\4.y\frameworks\projects\framework\src\mx\core\UIComponent.as:7199]
    at spark.components::Group/addDisplayObjectToDisplayList()[E:\dev\4.y\frameworks\projects\spark\src\spark\components\Group.as:2037]
    at spark.components::Group/http://www.adobe.com/2006/flex/mx/internal::elementAdded()[E:\dev\4.y\frameworks\projects\spark\src\spark\components\Group.as:1628]
    at spark.components::Group/setMXMLContent()[E:\dev\4.y\frameworks\projects\spark\src\spark\components\Group.as:633]
    at spark.components::Group/createChildren()[E:\dev\4.y\frameworks\projects\spark\src\spark\components\Group.as:855]
    at mx.core::UIComponent/initialize()[E:\dev\4.y\frameworks\projects\framework\src\mx\core\UIComponent.as:7634]
    at mx.core::UIComponent/http://www.adobe.com/2006/flex/mx/internal::childAdded()[E:\dev\4.y\frameworks\projects\framework\src\mx\core\UIComponent.as:7495]
    at mx.core::UIComponent/addChildAt()[E:\dev\4.y\frameworks\projects\framework\src\mx\core\UIComponent.as:7199]
    at spark.components::Group/addDisplayObjectToDisplayList()[E:\dev\4.y\frameworks\projects\spark\src\spark\components\Group.as:2037]
    at spark.components::Group/http://www.adobe.com/2006/flex/mx/internal::elementAdded()[E:\dev\4.y\frameworks\projects\spark\src\spark\components\Group.as:1628]
    at spark.components::Group/addElementAt()[E:\dev\4.y\frameworks\projects\spark\src\spark\components\Group.as:1387]
    at spark.components::SkinnableContainer/addElementAt()[E:\dev\4.y\frameworks\projects\spark\src\spark\components\SkinnableContainer.as:775]
    at mx.states::AddItems/addItemsToContentHolder()[E:\dev\4.y\frameworks\projects\framework\src\mx\states\AddItems.as:782]
    at mx.states::AddItems/apply()[E:\dev\4.y\frameworks\projects\framework\src\mx\states\AddItems.as:563]
    at mx.core::UIComponent/applyState()[E:\dev\4.y\frameworks\projects\framework\src\mx\core\UIComponent.as:10741]
    at mx.core::UIComponent/commitCurrentState()[E:\dev\4.y\frameworks\projects\framework\src\mx\core\UIComponent.as:10487]
    at mx.core::UIComponent/commitProperties()[E:\dev\4.y\frameworks\projects\framework\src\mx\core\UIComponent.as:8304]
    at spark.components.supportClasses::SkinnableComponent/commitProperties()[E:\dev\4.y\frameworks\projects\spark\src\spark\components\supportClasses\SkinnableComponent.as:452]
    at mx.core::UIComponent/validateProperties()[E:\dev\4.y\frameworks\projects\framework\src\mx\core\UIComponent.as:8219]
    at mx.managers::LayoutManager/validateProperties()[E:\dev\4.y\frameworks\projects\framework\src\mx\managers\LayoutManager.as:597]
    at mx.managers::LayoutManager/doPhasedInstantiation()[E:\dev\4.y\frameworks\projects\framework\src\mx\managers\LayoutManager.as:813]
    at mx.managers::LayoutManager/doPhasedInstantiationCallback()[E:\dev\4.y\frameworks\projects\framework\src\mx\managers\LayoutManager.as:1180]
    at flash.utils::Timer/_timerDispatch()
    at flash.utils::Timer/tick()

【问题讨论】:

您使用的是哪个版本的 Flex?我认为 Playbook 还不支持最新版本的 Flex/AIR。如果您使用的是 Flex 4.6,我认为默认的 TextInput 外观使用本机文本控件 (StageText) 而不是“默认”Flex 控件 (TextField)。 [在 4.5 中不是这种情况] 我使用的是 Flex 4.6。我应该降级到 4.5 还是有办法让它使用 Flex 控件而不是本机控件? 我不确定。我能找到的最佳信息是 Playbook 还不支持 AIR 3 (supportforums.blackberry.com/t5/Tablet-OS-SDK-for-Adobe-AIR/…)。如果是这样,您将不得不降级,否则 Captive Runtime 可能会起作用。 “旧皮肤”应该仍然存在,因此您可以将皮肤类指定为 'spark.skins.mobile.TextAreaSkin' 【参考方案1】:

PlayBook qnx.fuse 组件不能在 Flex 中使用。

关于 Flex AIR 版本,我相信 PlayBook 实际上在 PlayBookOS 1.0.8 和 2.0.0 上支持 Flex 4.6 和 AIR 3

【讨论】:

我一直在 OS 1.0.8 上进行测试,AIR 版本是 3.1.0.20,但是我收到了上面发布的错误。

以上是关于无法在 Blackberry 应用程序中创建文本输入的主要内容,如果未能解决你的问题,请参考以下文章

如何通过级联QML在blackberry 10设备文档目录中创建XML文件?

替换 Listview Blackberry 10 中的虚拟图像

在表格视图的特定单元格中创建文本字段

在 Blackberry Java 中的类之间调用

想通过以文本格式保留所有行和列来在 C# 中创建 excel 文件

在As3中创建一个动态表