gpt4 book ai didi

actionscript-3 - 文本输入文本不会显示,除非它集中在 flex 4.6 android 应用程序中

转载 作者:行者123 更新时间:2023-12-01 17:53:32 24 4
gpt4 key购买 nike

我正在使用flex 4.6和air 3.1为android开发一个AIR应用程序。在应用程序中,我有一个 View ,其中有一个文本输入和一个搜索按钮。输入一些文本并单击搜索按钮后将进入结果 View .从结果 View 中,用户可以通过单击后退按钮返回到搜索 View 。destructonPolicy SearchView 的值保留为 never我用navigator.popView()返回到搜索 View 。问题是当我返回搜索 View 时,文本输入是空的,其中它应该显示之前输入的文本。但是当焦点位于文本输入上时,文本就会出现。我希望在再次显示该 View 时立即显示文本。知道为什么会发生此问题

P.S- 当我在 Android 模拟器(OS 2.3.3)中检查安装 apk 后,会发生此问题。我没有 Android 设备来检查此问题。所以不确定是否是这样只是模拟器的问题。如果我使用 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="&lt;" 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" />

关于actionscript-3 - 文本输入文本不会显示,除非它集中在 flex 4.6 android 应用程序中,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/10331649/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com