我有一个Flex Mobile应用程序,我的ViewNavigatorApplication
设置为resizeForSoftKeyboard="true"
。这样,当调用软键盘时,显示的视图会调整大小。
视图简单易懂。当您在TextInput
上书写时,List
的项目将被过滤。因此,当您单击TextInput
时,softKeyboard
被引发并且应用程序被调整为大小,您不会丢失部分屏幕。这很有效但有时候,当TextInput
失去焦点并且softKeyboard
隐藏时,应用程序将不会重新调整大小。这可以通过转到上一个View
来解决,但不应该发生。
由于我没有足够的声誉来附加图片,我希望您可以转到下一个链接并查看显示我正在尝试解释的屏幕截图:
接下来是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>
我希望你能帮助我找到为什么会这样。这令人非常烦人,我不能在应用程序上有这种行为。任何提示将不胜感激。 的问候,
圣塞瓦斯蒂安