中央按钮软键LWUIT [英] Central Button Soft key LWUIT
问题描述
这似乎是一个非常琐碎的问题,但是我花了很多时间在此问题上,没有找到可行的解决方案.
This might seem like a very trivial problem but I have spent quite some time on this without finding a viable solution.
诺基亚设备具有中央选择按钮,可让我们为其分配软键.
Nokia devices have a central select button,which allows us to assign soft keys to it.
根据我的要求,我需要分配一个特定的命令作为软键.例如,在一个屏幕上可能是播放",而在另一屏幕上可能是选择".请注意,我已经使用以下命令设置了默认选择命令:
According to my requirement, I need to assign a specific command as the soft key. For instance it might be "Play" on one screen and "Select" on other. Note that I have a default select command already set using:
setDefaultCommand((Command) v.elementAt(v.size() - 1));
它始终是右侧菜单中的第一个命令,并在按下中央选择按钮时被调用.
which is always the first command in the menu at the right and is invoked when central select button is pressed.
据我了解,将命令分配给每个软键的方式非常随意,并且因设备而异.由于已经设置了默认命令,因此可以通过两种方式解决我的问题:
From what I read, the way commands are assigned to each soft key is very arbitrary and varies from device to device. Since I have a default command already set, my problem can be solved in two ways:
1.通过使用中心按钮设置软键
1.By setting a soft key to the central button using
Display.getInstance().setThirdSoftButton(true);
我尝试过这种方法,但是分配命令的方式是非常随机的.另外,菜单中始终会添加一个默认命令选择".有没有一种方法可以对此进行自定义,以便在中央按钮上方显示一个非常具体的命令?
I tried this, but the way commands are assigned is very random. Also,there is a default command "Select" always added to the menu. Is there a way to customize this so that a very specific command is shown above the central button?
2.只需分配标签,即可在中央软键中显示如上设置的默认命令.
2.By just assigning a label so that the default command set as above is displayed in the central soft key.
推荐答案
第3个软键模式具有许多可聚焦组件的默认实现,但没有标签的实现.您可以通过在组件上调用setSelectCommandText(String)
来自定义其标签.
The 3rd softbutton mode has default implementations for many focusable components but not for labels. You can customize its label by invoking setSelectCommandText(String)
on the component.
我建议不要在中心命令中使用标签,而是使用一个按钮,并将其UIID设置为Label(如果希望它作为标准标签显示).
I suggest that rather than using a label for a center command just use a button and set it's UIID to Label if you want it to appear as a standard label.
这篇关于中央按钮软键LWUIT的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!