2011-12-14 1 views
0

콤보 대신 모바일 응용 프로그램에서 사용하기 위해 Flex 4.6에서 설명 선 컨트롤을 사용해 왔습니다. 사용자가 "선택 ..."할 것인지 묻는 TextInput이 있고 그 손가락을 만지면 (iPad) 포커스를 받고 목록에서 선택할 수 있도록 설명 선이 채워집니다.편집이 비활성화 된 경우 Flex TextInput이 FocusIn 이벤트를 발생시키지 않습니다.

Mac에서는이 기능이 제대로 작동하지만 iPad로 배포 할 때 TextInput 컨트롤의 편집 기능이 켜져있는 경우에만 focusIn 이벤트가 발생하는 것 같습니다. 이것은 소프트 키보드가 팝업되고 컨트롤이 편집 가능하기 때문에 목적을 무효화합니다. 실제로 목록에서 선택되기를 원할 때 편집 가능합니다.

TextInput 컨트롤의 코드는 다음과 같습니다.

<s:TextInput id="txtLocation" x="171" y="149" 
      enabled="false" editable="false" 
      height="38" fontSize="16" 
      prompt="Select ..." 
      focusEnabled="true" 
      focusIn="depotCallout.open(this.txtLocation,true)"/> 

이 코드는 선을 사용하는 방법을 보여 홀리 Schinsky하여 샘플 응용 프로그램도 있습니다. 어떤 아이디어라도 감사 할 것입니다.

답변

1

좋아, 나는 전문적인 코더가 아닌 약간의 견해를 갖고 있었지만 대답을 발견했다. Adobe fex 4.6

:

 <?xml version="1.0" encoding="utf-8"?> 
    <!-- mobile_keyboard/views/UseNextLikeTab.mxml --> 
    <s:View xmlns:fx="http://ns.adobe.com/mxml/2009" 
      xmlns:s="library://ns.adobe.com/flex/spark" title="Change Focus"> 
     <fx:Declarations> 
      <!-- Place non-visual elements (e.g., services, value objects) here --> 
     </fx:Declarations> 

     <s:layout> 
      <s:VerticalLayout paddingTop="10" paddingLeft="10" paddingRight="10"/> 
     </s:layout> 

     <fx:Script> 
      <![CDATA[ 
       private function changeField(ti:TextInput):void { 
        // Before changing focus to a new control, set the stage's focus to null: 
        stage.focus = null; 

        // Set focus on the TextInput that was passed in: 
        ti.setFocus(); 
       } 
      ]]> 
     </fx:Script> 

     <s:HGroup> 
      <s:Label text="1:" paddingTop="15"/> 
      <s:TextInput id="ti1" prompt="First Name" 
         width="80%" 
         returnKeyLabel="next" 
         enter="changeField(ti2)"/>  
     </s:HGroup> 
     <s:HGroup> 
      <s:Label text="2:" paddingTop="15"/> 
      <s:TextInput id="ti2" prompt="Middle Initial" 
         width="80%" 
         returnKeyLabel="next" 
         enter="changeField(ti3)"/> 
     </s:HGroup> 
     <s:HGroup> 
      <s:Label text="3:" paddingTop="15"/> 
      <s:TextInput id="ti3" prompt="Last Name" 
         width="80%" 
         returnKeyLabel="next" 
         enter="changeField(ti1)"/> 
     </s:HGroup> 

    </s:View> 

나는이 페이지에 코드를 발견

관련 문제