Flex 防止软键盘关闭
我有一个布局简单的移动 AIR 应用程序:
<s:layout><s:VerticalLayout /></s:layout>
<s:TextArea width="100%" height="100%" />
<HGroup width="100%" >
<s:Button label="button" />
<s:Button label="button" />
<s:Button label="button" />
</HGroup>
通过在主应用程序中设置 resizeForSoftKeyboard="true",将应用程序设置为在软键盘打开时调整大小。 textArea 使用默认的 Flex 4.6 外观。
我的问题是,如果用户通过在我的 texArea 中输入文本来打开键盘,他将无法单击 TextArea 下面的按钮,因为一旦他尝试单击按钮,软键盘就会降低(因为将焦点移出)的 TextArea?)并立即再次打开(因为 mouseDown 位置现在位于 TextArea 上方?)。
如何防止软键盘关闭,以便用户能够单击 TextArea 和键盘之间的按钮?
谢谢
I have a mobile AIR app with a simple layout:
<s:layout><s:VerticalLayout /></s:layout>
<s:TextArea width="100%" height="100%" />
<HGroup width="100%" >
<s:Button label="button" />
<s:Button label="button" />
<s:Button label="button" />
</HGroup>
The application is set to resize when the soft keyboard opens by setting resizeForSoftKeyboard="true" in the main app. The textArea uses the default Flex 4.6 skin.
My problem is, that if the user opens the keyboard by typing text into my texArea, he will be unable to click the buttons below the TextArea, because as soon as he tries to click a button the soft keyboard lowers (because the focus it out of the TextArea?) and immediately opens again (because the mouseDown position is now above the TextArea?).
How can i prevent the soft keyboard from closing, so the user is able to click the buttons between the TextArea and the keyboard?
Thanks
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
这很奇怪。我尝试自己运行你的程序,一点问题都没有:
当我触摸文本区域时键盘打开,当我单击按钮时键盘关闭(不再打开),并且在调试时点击显示在控制台中。
您没有发布整个应用程序,完整的程序中是否有我没有的内容?在这种情况下,我会看看其中是否会干扰用户界面。
This is very strange. I tried running your program myself, and I have no trouble at all:
The keyboard opens when I touch the text area, closes when I click a button (without opening again), and the clicks show up in the console when debugging.
You didn't post the entire app, do you have anything in the complete program that I don't? In that case, I would see if any of that could interfere with the UI.
也许添加一个事件以在单击按钮时调出键盘,即在该按钮的单击事件处理程序中。
另外(我自己没有尝试过),但在该视图的键盘停用事件中,添加 event.preventDefault()
Brian
Maybe add an event to bring up the keyboard when the button is clicked i.e. in the click event handler of that button.
Also (and I havnt tried this myself), but in the deactivate event for the keyboard for that view, add event.preventDefault()
Brian