如何添加软件键盘上的MENU按钮 [英] How to add menu button on the software keyboard

查看:251
本文介绍了如何添加软件键盘上的MENU按钮的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

不知道,如果标题是正确的,但这里是我需要的。
我的Xperia V,和我猜,最喜欢的新手机,它并没有在手机上的任何按钮,而是他们出现在显示器本身,主页,返回和类似的任务,不知道...
我想知道的是我怎么添加一个菜单按钮旁边的一个应用这3个按钮,你知道什么时候有它出现在那里的应用程序标题栏,但没有标题栏这个菜单按钮(它的3个点)必须旁边的其他软件按钮。
我怎样才能做到这一点在我的应用程序?

not sure if the title is correct, but here's what I need. I have Xperia V, and as I guess, like most new phones, it does not have any buttons on the phone, but instead they appear on the display itself, the Home, Back and something like Tasks, dont know... What I want to know is how do I add a menu button next to these 3 buttons in an app, you know when there is a title bar in the app it appears up there, but with no title bar this menu button (its 3 dots) must be next to the other software buttons. How can I do it in my app?

推荐答案

对于初学者来说,你会得到很多人在这里告诉你,这是一个坏主意,和一个老UI模式。他们是对的...

For starters, you will get a lot of people telling you here that this is a bad idea, and an old UI pattern. They are right...

下面是我的一个相关的问题的答案 - 也大量关于该主题的其他意见(一些很有趣):

Here is my answer on a related question - and also lots of other opinions on the topic (some quite amusing):

  • Show options menu button on Galaxy Nexus (Android 4.1)

我特别喜欢的殇兼容性菜单的参考,从 @ nicopico的回答

I particularly enjoy Compatibility Menu of Shame reference from @nicopico's answer.

请考虑,如果你真的想 - 只有在极端情况下使用,如可能你的客户是坚持。否则,避免了这种模式。

Please consider if you really want it - only use in extreme cases, like maybe your client is insisting. Otherwise avoid this pattern.

您可以设置您的构建目标来之前ICS版本(即直至并包括13 API /蜂巢3.2)。

You can set your build target to a version before ICS (i.e. up to and including API 13 / HoneyComb 3.2).

<uses-sdk
    android:minSdkVersion="7"
    android:targetSdkVersion="13" />

这将得到系统使用,把一个图标到您手机的底部按钮栏兼容模式设置 - 这应该提供你所追求的功能。 pressing此按钮将作为$ P $相同的响应pssing对三星Galaxy S2一个菜单按钮,例如。

That will get the system to use a compatibility mode setting that inserts an overflow icon into your phone's bottom button bar - this should provide the functionality you are after. Pressing this button will have the same response as pressing a "menu" button on the Samsung Galaxy S2 for example.

在这里,您可以看到兼容性选项按钮,当它已经显示的菜单pressed:

Here you can see the compatibility "options" button, and the menu that has been shown when it was pressed:

至于其他评论提到,你应该考虑更好的选择动作条格局。如果你想向后兼容性,那么我建议的操作栏福尔摩斯库。

As other commentators mention, you should consider the better choice of the ActionBar pattern. If you want backwards compatibility, then I recommend the Action Bar Sherlock library.

但是,如果你正在寻找一种快速解决,或者客户端无法承受大的重构移动到操作栏模式,那么这是做它的方式。

But if you are looking for a quick fix, or the client can't afford a big refactor to move to the Action Bar pattern, then this is the way to do it.

这篇关于如何添加软件键盘上的MENU按钮的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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