Flex Mobile:应用程序会在出现软键时调整大小,但在隐藏时不会调整大小

时间:2013-12-06 15:07:29

标签: android flex resize android-softkeyboard flex-mobile

我有一个Flex Mobile应用程序,我的ViewNavigatorApplication设置为resizeForSoftKeyboard="true"。这样,当调用软键盘时,显示的视图会调整大小。

视图简单易懂。当您在TextInput上书写时,List的项目将被过滤。因此,当您单击TextInput时,softKeyboard被引发并且应用程序被调整为大小,您不会丢失部分屏幕。这很有效但有时候,当TextInput失去焦点并且softKeyboard隐藏时,应用程序将不会重新调整大小。这可以通过转到上一个View来解决,但不应该发生。

由于我没有足够的声誉来附加图片,我希望您可以转到下一个链接并查看显示我正在尝试解释的屏幕截图:

enter image description here

接下来是View

的代码
<?xml version="1.0" encoding="utf-8"?>
<s:View xmlns:fx="http://ns.adobe.com/mxml/2009"        
                 xmlns:s="library://ns.adobe.com/flex/spark"
                 xmlns:componets="componets.*"
                 xmlns:views="views.*">



    <fx:Declarations>
        <s:HTTPService id="getService"                                                                                                
                       requestTimeout="5"
                       method="GET"
                       result="getItemsHandler(event)"/>
        <s:HTTPService id="getItemService"                                                                                                
                       requestTimeout="5"
                       method="GET"
                       result="serviceReturned(event)"
                       fault="serviceReturned(event)"/>
    </fx:Declarations>



    <fx:Script>
        <![CDATA[               
            import com.adobe.serialization.json.JSON;
            import com.adobe.serialization.json.JSONParseError;

            import mx.collections.ArrayCollection;
            import mx.core.IVisualElement;
            import mx.rpc.events.FaultEvent;
            import mx.rpc.events.ResultEvent;

            import singletons.AppConfiguration;
            import valueobjects.data.Contact;


            private var internalConfiguration:AppConfiguration = AppConfiguration.getInstance();                        


            override protected function createChildren():void
            {               
                super.createChildren();
                configureComponents();
                initializeList();
            }

            private function initializeList():void
            {
                if (internalConfiguration.Contacts != null)
                {
                    internalConfiguration.Contacts.filterFunction = filterList;
                    internalConfiguration.Contacts.refresh();
                }                               
                groupList.dataProvider = internalConfiguration.Contacts;                                                
            }                                   

            private function filterList(item:Object):Boolean
            {
                var contact:Contact = item as Contact;              
                var searchText:String = (contact.id + contact.name + contact.lastname).toLowerCase();
                searchText = searchText.toLowerCase();              
                var patern:String = filterText.text.toLowerCase();
                if (searchText.indexOf(patern) > -1)
                    return true;
                else
                    return false;
            }

            /**
             * Handles the retrieved directory data and stores it.
             */
            private function getItemsHandler(event:ResultEvent):void
            {
                BLABLABLA...                
            }

            protected function contactSelected(event:MouseEvent):void
            {   
                if(groupList.selectedIndex == -1)
                {
                    return;
                }
                var person:Contact = groupList.selectedItem as Contact;
                getItemService.request.id = person.id;
                getItemService.request.name = person.name;          
                getItemService.send();              
                groupList.selectedItem = null;
            }

        ]]>
    </fx:Script>


    <s:Group id="componentsGroup"
             width="100%" height="100%">
        <s:Button id="backButton"                         
              click="backHandler()"/>   
        <s:TextInput id="filterText"                     
                     keyUp="internalConfiguration.Contacts.refresh()"/>
        <s:List id="groupList"              
                itemRenderer="components.renderers.ContactRenderer"
                click="contactSelected(event)"
                top="145" left="20" right="20" bottom="20">
        </s:List>
    </s:Group>  

</s:View>

我希望你能帮助我找到为什么会这样。这令人非常烦人,我不能在应用程序上有这种行为。任何提示将不胜感激。 的问候,

圣塞瓦斯蒂安

0 个答案:

没有答案