1

开发环境: Flash Builder 4.7
SDK: Flex 4.6.0 (build 23201) AIR 3.5
参数: -local en_US -swf-version=16
测试平台: iPad 2 上的 iOS 6

严重的错误,我相信。使使用这些技术开发的 iOS 应用程序完全无法使用。

情况:每当我在测试平台设备上触摸 TextInput 组件时,它会执行以下两种操作之一:

  1. 它将按预期执行。它获得焦点(调度了 focusIn 事件),围绕它的蓝色焦点矩形,提示文本被闪烁的光标替换,软键盘激活并显示(调度所有预期的事件)。
  2. 它会失败。它将获得焦点(调度focusIn事件),蓝色焦点矩形会短暂出现然后消失,提示文本保持显示并且字段中没有光标(调度focusOut事件)。调度 softKeyboardActivate 事件并立即调度 softKeyboardDeactivate 事件。键盘甚至没有短暂出现。

我可以轻敲轻敲,最终轻敲(与其他任何轻敲)都会成功,并且会发生#1而不是#2。

这是最奇怪的事情。focusManager 告诉我,在调度 focusIn 事件和调度 focusOut 事件后,具有焦点的 DisplayObject 是同一个对象(如果我使用计时器每 10 毫秒检查一次,结果不会改变......正确DO有重点。

代码下方是跟踪输出。

<?xml version="1.0" encoding="utf-8"?>
<s:ItemRenderer xmlns:fx="http://ns.adobe.com/mxml/2009" 
                            xmlns:s="library://ns.adobe.com/flex/spark" 
                            xmlns:mx="library://ns.adobe.com/flex/mx" 
                            xmlns:c="components.*"
                            width="100%"
                            creationComplete="creationCompleteHandler()">

    <fx:Declarations>
            <s:DropShadowFilter id="dropShadowFilter" blurX="6" blurY="6" alpha="0.5" distance="6" angle="60" strength=".5" quality="{BitmapFilterQuality.HIGH}"/>
    </fx:Declarations>

    <fx:Script>
            <![CDATA[
                    import flash.filters.BitmapFilterQuality;

                    import mx.utils.ObjectProxy;

                    import spark.skins.mobile.TextAreaSkin;

                    import views.tools.MakeAToolBase;

                    [Bindable]
                    private var pad:Number = 15;

                    [Bindable]
                    public var dataProxy:ObjectProxy;

                    [Bindable]
                    public var v:MakeAToolBase;

                    protected function creationCompleteHandler():void
                    {
                            trace("LearnItListItemRenderer FUNCTION creationCompleteHander()");
                            dataProxy = new ObjectProxy(data);
                            dataProxy.choosePictureButton = choosePictureButton;
                    }

            ]]>
    </fx:Script>

    <s:layout>
            <s:HorizontalLayout horizontalAlign="center"/>
    </s:layout>

    <s:HGroup id="listItem" gap="33" paddingTop="15" paddingBottom="15" horizontalAlign="center" paddingLeft="15" paddingRight="44"
                      verticalAlign="middle" width="100%" height="210" filters="{[dropShadowFilter]}">

            <s:Group height="100%">
                    <s:Rect height="100%" width="100%" radiusX="5" radiusY="5">
                            <s:fill>
                                    <s:SolidColor color="0xffffff" alpha="1"/>
                            </s:fill>
                            <s:stroke>
                                    <s:SolidColorStroke weight=".5" color="0x000066"/>
                            </s:stroke>
                    </s:Rect>

                    <s:Label text="{dataProxy.numberLabel}" fontSize="32" color="#000072" verticalAlign="middle" verticalCenter="0" paddingLeft="12" paddingRight="12"/>
            </s:Group>

            <c:ChoosePictureButton id="choosePictureButton" height="{listItem.height-pad-pad}" width="{(4*(listItem.height-pad-pad))/3}"/>

            <s:VGroup id="textInputBoxesGroup" height="100%" width="100%">
                    <s:TextInput id="behaviorNameTextInput" color="#000000" textAlign="left" width="100%"
                                            prompt="Enter Behavior Name..."
                                            needsSoftKeyboard="true"
                                            interactionMode="touch"
                                            skinClass="spark.skins.mobile.TextInputSkin"
                                            returnKeyLabel="done"
                                            showPromptWhenFocused="true"
                                            touchBegin="trace('touch');"
                                            softKeyboardActivate=  "trace('#############################    SoftKeyboardActive    #####################################');"
                                            softKeyboardDeactivate="trace('############################# SoftKeyboardDeactivating #####################################');"
                                            softKeyboardActivating="trace('#############################  SoftKeyboardActivating  #####################################');"
                                            focusIn="trace('TEXTINPUT FOCUSIN: '+this.focusManager.getFocus())"
                                            focusOut="trace('TEXTINPUT FOCUSOUT: '+this.focusManager.getFocus())"
                                            creationComplete="{data.behaviorNameTextInput=behaviorNameTextInput;}"
                                            />

                    <s:Spacer id="behaviorSpacer" height="2"/>

                    <s:TextArea id="behaviorDescriptionTextArea"
                                            fontFamily="verdana" fontSize="16"
                                            verticalAlign="top" textAlign="left" width="100%" height="100%"
                                            verticalScrollPolicy="on"
                                            interactionMode="touch"
                                            color="#000000" prompt="Enter Behavior Description..."
                                            softKeyboardType="{SoftKeyboardType.DEFAULT}"
                                            needsSoftKeyboard="true"
                                            showPromptWhenFocused="true"
                                            skinClass="spark.skins.mobile.TextAreaSkin"
                                            creationComplete="{data.behaviorDescriptionTextArea=behaviorDescriptionTextArea}"/>
            </s:VGroup>
            <c:YesNoVerticalButtonsGroup/>
    /s:HGroup>
</s:ItemRenderer>

跟踪输出 [为简洁而编辑]

TEXTINPUT FOCUSIN: PictureToolsOnTheMoveMakeIt0.TabbedViewNavigatorApplicationSkin6.tabbedNavigator.TabbedViewNavigatorSkin8.contentGroup._PictureToolsOnTheMoveMakeIt_ViewNavigator3.ViewNavigatorSkin35.contentGroup.MakeAToolLearnItView471.SkinnableContainerSkin472.contentGroup.itemList.ListSkin475.Scroller477.ScrollerSkin478.DataGroup476.LearnItListItemRenderer566.listItem.textInputBoxesGroup.behaviorNameTextInput

#############################  SoftKeyboardActivating  #####################################

############################# SoftKeyboardDeactivating #####################################

TEXTINPUT FOCUSOUT: PictureToolsOnTheMoveMakeIt0.TabbedViewNavigatorApplicationSkin6.tabbedNavigator.TabbedViewNavigatorSkin8.contentGroup._PictureToolsOnTheMoveMakeIt_ViewNavigator3.ViewNavigatorSkin35.contentGroup.MakeAToolLearnItView471.SkinnableContainerSkin472.contentGroup.itemList.ListSkin475.Scroller477.ScrollerSkin478.DataGroup476.LearnItListItemRenderer566.listItem.textInputBoxesGroup.behaviorNameTextInput

############################# SoftKeyboardDeactivating #####################################

[ 失败的尝试 2 - 22 为了可读性而删除]

TEXTINPUT FOCUSIN: PictureToolsOnTheMoveMakeIt0.TabbedViewNavigatorApplicationSkin6.tabbedNavigator.TabbedViewNavigatorSkin8.contentGroup._PictureToolsOnTheMoveMakeIt_ViewNavigator3.ViewNavigatorSkin35.contentGroup.MakeAToolLearnItView471.SkinnableContainerSkin472.contentGroup.itemList.ListSkin475.Scroller477.ScrollerSkin478.DataGroup476.LearnItListItemRenderer566.listItem.textInputBoxesGroup.behaviorNameTextInput

#############################  SoftKeyboardActivating  #####################################

#############################    SoftKeyboardActive    #####################################
4

0 回答 0