use*_*284 4 apache-flex air actionscript-3 android-emulator flex4.6
我正在使用flex 4.6和air 3.1为android开发AIR应用程序.在应用程序中我有一个视图,其中有一个textinput和一个搜索按钮.输入一些文本并单击搜索按钮将进入结果视图.从结果视图用户可以通过单击后退按钮返回到searchview.SearchView destructonPolicy保持为never和我navigator.popView()用来返回searchview.问题是当我回到搜索视图时textinput是空的,其中它应该显示txt是以前键入.但是当焦点在textnput上时,文本出现.我希望一旦再次显示该视图就会显示该文本.不知道为什么会出现这个问题
PS-当我在Android模拟器(OS 2.3.3)中检查aftr installng apk时发生这个问题.我没有安检设备来检查这个.所以不确定它是否只是模拟器的问题.如果我使用flex 4.5.1sdk这个问题没有发生
这是代码
主要mxml:
<?xml version="1.0" encoding="utf-8"?>
<s:ViewNavigatorApplication xmlns:fx="http://ns.adobe.com/mxml/2009"
xmlns:s="library://ns.adobe.com/flex/spark" firstView="views.HomeView">
</s:ViewNavigatorApplication>
Run Code Online (Sandbox Code Playgroud)
HomeView.mxml:
<?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" title="HomeView" destructionPolicy="never">
<fx:Script>
<![CDATA[
protected function button1_clickHandler(event:MouseEvent):void
{
navigator.pushView(ResultView);
}
]]>
</fx:Script>
<s:layout>
<s:VerticalLayout horizontalAlign="center"/>
</s:layout>
<s:TextInput prompt="Enter some text"/>
<s:Button label="Search" click="button1_clickHandler(event)"/>
</s:View>
Run Code Online (Sandbox Code Playgroud)
ResultView.mxml:
<?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" title="ResultView">
<fx:Script>
<![CDATA[
protected function button1_clickHandler(event:MouseEvent):void
{
navigator.popView();
}
]]>
</fx:Script>
<s:navigationContent>
<s:Button label="<" click="button1_clickHandler(event)"/>
</s:navigationContent>
</s:View>
Run Code Online (Sandbox Code Playgroud)
由于Flex 4.6存在问题; 但不是Flex 4.5,它可能是使用StageText的新默认TextInput外观的副作用/重绘问题.我在这里写了一点.
在4.6应用程序中,尝试设置默认的Flex 4.5皮肤:
<textInput skinClass="spark.skins.mobile.TextInputSkin" />
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
1862 次 |
| 最近记录: |