我的操作栏溢出菜单下拉列表出现问题。它显示在操作栏本身的顶部。我希望它显示在操作栏和溢出按钮下方。我正在使用android studio进行开发。
这是我的菜单
<menu xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
tools:context="com.xxx.messageapp.MessageActivity" xmlns:app="http://schemas.android.com/apk/res-auto">
<item
android:id="@+id/menu_overflow"
android:icon="@drawable/abs__ic_menu_moreoverflow_normal_holo_dark"
android:orderInCategory="1"
app:showAsAction="always" android:title="@string/action_messages">
<menu>
<item android:id="@+id/action_messages" android:title="@string/action_messages"
android:orderInCategory="100" app:showAsAction="always" android:icon="@drawable/icon_messages" />
<item android:id="@+id/action_maps" android:title="@string/action_maps"
android:orderInCategory="100" app:showAsAction="always" android:icon="@drawable/icon_bus" />
<item android:id="@+id/action_settings" android:title="@string/action_settings"
android:orderInCategory="100" app:showAsAction="always" android:icon="@drawable/icon_settings" />
<item android:id="@+id/action_logout" android:title="@string/action_logout"
android:orderInCategory="100" app:showAsAction="always" android:icon="@drawable/icon_logout" />
</menu>
</item>
</menu>
这是我的班级
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
Intent intent = getIntent();
setContentView(R.layout.activity_message);
ActionBar actionBar = getSupportActionBar();
actionBar.setDisplayHomeAsUpEnabled(true);
}
@Override
public boolean onCreateOptionsMenu(Menu menu) {
MenuInflater inflater = getMenuInflater();
inflater.inflate(R.menu.menu_message, menu);
return super.onCreateOptionsMenu(menu);
}
答案 0 :(得分:0)
这似乎是支持库的缺陷,已经提交了一个错误: https://code.google.com/p/android-developer-preview/issues/detail?id=1776
此致 涓