actionscript-3 – 除非专注于flex 4.6 android应用程序,否则不
发布时间:2020-12-15 01:46:06 所属栏目:百科 来源:网络整理
导读:我正在使用flex 4.6和air 3.1开发一个用于 android的AIR应用程序.在应用程序中我有一个视图,其中有一个textinput和一个搜索按钮.输入一些文本并单击搜索按钮将进入结果视图.从结果视图用户可以通过单击后退按钮返回到searchview.SearchView的destructonPolic
我正在使用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.1 sdk这个问题没有发生 这是代码 主要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> 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> 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> 解决方法
由于Flex 4.6存在问题;但不是Flex 4.5,它可能是使用StageText的新默认TextInput外观的副作用/重绘问题.我写了一篇关于
here的文章.
在4.6应用程序中,尝试设置默认的Flex 4.5皮肤: <textInput skinClass="spark.skins.mobile.TextInputSkin" /> (编辑:李大同) 【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容! |