開発環境: Flash Builder 4.7
SDK: Flex 4.6.0 (ビルド 23201) AIR 3.5
引数: -local en_US -swf-version=16
テストプラットフォーム: iPad 2 上の iOS 6
深刻なバグだと思います。これらのテクノロジーを使用して開発された iOS アプリをまったく使用できなくします。
状況: テスト プラットフォーム デバイスで TextInput コンポーネントに触れると、次の 2 つのいずれかが実行されます。
- 想定どおりに実行されます。フォーカスを取得し (focusIn イベントがディスパッチされます)、青いフォーカス四角形がそれを囲み、プロンプト テキストが点滅するカーソルに置き換えられ、ソフト キーボードがアクティブになり、表示されます (予想されるすべてのイベントがディスパッチされます)。
- 失敗します。フォーカスを取得し (focusIn イベントが送出されます)、青いフォーカス四角形が一時的に表示されてから消えます。プロンプト テキストは表示されたままになり、フィールドにはカーソルがありません (focusOut イベントが送出されます)。softKeyboardActivate イベントが送出され、すぐに softKeyboardDeactivate イベントが送出されます。キーボードが一瞬でも表示されません。
タップ タップ タップ タップすると、最終的に 1 回のタップ (他のタップと変わらない) が成功し、2 番目の代わりに 1 番目のタップが発生します。
これが最も奇妙なことです。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 #####################################