代号中的按钮一种形式在Android实际设备上不活动,但在模拟器下可以使用 [英] Buttons in Codename One form inactive on Android actual device but work under simulator

查看:65
本文介绍了代号中的按钮一种形式在Android实际设备上不活动,但在模拟器下可以使用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在我的代号一个应用程序中,我有2个表格A和B.表单包括每10秒钟更新一次的MapContainer和一个浮动按钮。如果用户单击浮动按钮,则可以拍照,然后显示一个对话框,如果选择确定,则显示B表单:

In my Codename One app I have 2 Forms A & B. A Form includes a MapContainer updated every 10 s and a floating button. If the user clicks on the floating button, they can take a picture and then a Dialog is shown and if they choose "OK" the B Form is shown :

new B_Form(theme).show(); // (where theme is the Resources used in A Form). 

此B表单包含用于执行某些操作的按钮(例如,录制音频,播放录制的音频,转到表格A)。这些按钮可在模拟器中运行(尽管不支持录制,因此会显示错误,但可能会出现此错误),也就是说用户可以单击它。

This B Form includes buttons to take some action (ie record audio, play the recorded audio, go to Form A). The buttons work in the simulator (although recording is not supported so an error is shown but it is expected), that is the user can click on it.

但是在显示了实际设备(Android KitKat)B表格,但是尽管所有按钮均已启用,但无法执行任何操作。这些按钮甚至在按下时也不显示其按下样式,而是保持未选择状态。

However on an actual device (Android KitKat) B Form is shown but no action can be taken although the buttons are all enabled. The buttons even don't show their "pressed style" when being pressed, and remain in "unselected state".

唯一有效的按钮是 setBackCommand 从工具栏(即屏幕左上角的左箭头)。

The only button that works is the setBackCommand from the Toolbar (ie the left arrow on the upper left corner of the screen).

所以它看起来像B窗体没有被考虑在内。此外,如果我在B表单上滑动手指,则会显示A表单,并且地图也会移动。如果我从A表单中删除了MapContainer,则B表单将在设备上按预期工作。

So it looks like the B Form was not taken into account. Moreover if I swipe my finger on the B Form then A Form is shown and the map is moved. If I removed the MapContainer from the A Form then B Form works as expected on the device.

EDIT

令人惊讶的是,如果我通过汉堡菜单从侧面菜单栏中调用Form C,则该Form C上的按钮将无缝运行!

所以我感觉到MapContainer给我带来了麻烦,我该怎么做才能使B Form正常工作?

So I get the feeling that the MapContainer is causing me trouble, what can I do to make B Form work as expected ?

任何帮助,

问候

推荐答案

MapContainer 对等组件,我们在Android上启用了新的对等设备,这些设备隐藏了对等系统的某些复杂性,但可能会引发其他问题。

The MapContainer is a peer component, we enabled the new peers on Android which hide some of the complexities of the peer system but might trigger other issues.

这可能是不当行为对等组件系统,尽管我很难理解如何重现该组件。侧面菜单之所以起作用,是因为侧面菜单是完全不同的形式,没有地图容器。

This might be a misbehavior of the peer component system, although it's hard for me to understand how to reproduce this. The side menu would work because the side menu is a completely different form without the map container in it.

这篇关于代号中的按钮一种形式在Android实际设备上不活动,但在模拟器下可以使用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆