【问题标题】:Why cannot I see the options menu button?为什么我看不到选项菜单按钮?
【发布时间】:2013-05-17 17:16:54
【问题描述】:

我在 Eclipse 中使用 android。我为这个版本申请了。

在我的 AndroidManifest 中。

    <uses-sdk
    android:minSdkVersion="10"
    android:targetSdkVersion="17" />

我制作了一个包含四个项目的典型菜单:

<?xml version="1.0" encoding="utf-8"?>
<menu xmlns:android="http://schemas.android.com/apk/res/android" >

<item android:id="@+id/preferences"
    android:title="@string/preferences"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:icon="@android:drawable/ic_menu_preferences">
</item>
<item android:id="@+id/galery"
    android:title="@string/galery"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:icon="@android:drawable/ic_menu_gallery">
</item>
<item android:id="@+id/send"
    android:title="@string/send"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:icon="@android:drawable/ic_menu_upload">
</item>
<item android:id="@+id/Camera"
    android:title="@string/camera"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:icon="@android:drawable/ic_menu_camera">
</item>
</menu>

如果我使用例如 15 版本,我有菜单按钮,如果我按下它,我可以看到我的菜单。 但是我的问题是Jelly Bean版本,因为模拟器没有任何按钮,而新手机也没有,因为它们的屏幕上有一个按钮,带有三个点,就像那样。

http://www.blocketpc.com/imagenes/android_ics_menu.png

我应该在我的 xml 文件中配置一些东西,还是我必须在我的 eclipse 模拟器中配置一些东西? 我也想在我的模拟器中看到这些点。而且我不想激活硬件键盘,因为在现实生活中你没有这些按钮。 我正在使用 17 版本的 Galaxy nexus 模拟器。

谢谢!!!

【问题讨论】:

    标签: android eclipse menu emulation


    【解决方案1】:

    Android 正在逐步淘汰菜单按钮,转而使用 ActionBar。这应该是你的问题。这是一篇包含信息的好文章。

    http://android-developers.blogspot.com/2012/01/say-goodbye-to-menu-button.html

    【讨论】:

    • 你会推荐我什么,带有 targetSdkVersion 13 的操作栏或菜单?谢谢你的回答!
    • 如果您的应用是新应用并且需要使用新功能,我会选择 ActionBar。如果您可能需要支持早期版本,并且您真的不需要使用 Jelly bean 的任何新功能,那么最好将版本保持为 13。希望能帮助您做出决定:-)
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2015-03-09
    • 2021-06-25
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多