【发布时间】:2013-03-14 18:03:02
【问题描述】:
我正在尝试借助 ActionBarSherlock 在 Android 2.3 应用程序中实现选项菜单。但它不显示。这是选项菜单的简单 XML 布局文件“breadcrumb_bar_menu”:
<?xml version="1.0" encoding="utf-8"?>
<menu xmlns:android="http://schemas.android.com/apk/res/android" >
<item android:id="@+id/inbox"
android:icon="@drawable/topbar_btn_inbox"
android:title= "@string/about" />
<item android:id="@+id/sent"
android:icon="@drawable/topbar_sent"
android:title="@string/about" />
</menu>
这是我从 SherlockActivity 继承的活动:
public boolean onCreateOptionsMenu(Menu menu) {
MenuInflater inflater = getSupportMenuInflater();
inflater.inflate(R.menu.breadcrumb_bar_menu, menu);
return true;
}
但我在活动上看不到选项菜单。我做错了什么?
【问题讨论】:
-
您在哪个版本的 Android 操作系统上测试应用程序?有硬件菜单按钮吗?
-
@ShajeelAfzal 请仔细阅读我的问题。我说的是版本。
标签: java android actionbarsherlock