相关疑难解决方法(0)

为什么我的溢出下拉菜单位于操作栏的顶部?

操作栏顶部的下拉列表

默认情况下它不应该在操作栏下面吗?那么我做错了什么?

@Override
public boolean onCreateOptionsMenu(Menu menu) {
    // Inflate the menu; this adds items to the action bar if it is present.
    getMenuInflater().inflate(R.menu.main, menu);
    return true;
}
Run Code Online (Sandbox Code Playgroud)

RES /菜单/ main.xml中

<menu xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
tools:context="com.example.test.MainActivity" >

<item
    android:id="@+id/action_settings"
    android:orderInCategory="100"
    android:title="@string/action_settings"
    app:showAsAction="never"/>
</menu>
Run Code Online (Sandbox Code Playgroud)

java android android-actionbar

8
推荐指数
3
解决办法
6831
查看次数

标签 统计

android ×1

android-actionbar ×1

java ×1