我遇到过同样的问题.我能找到解决问题的唯一方法是用工具栏替换操作栏.
// Replace the action bar with a toolbar
Toolbar toolbar = (Toolbar)findViewById(R.id.tool_bar);
setSupportActionBar(toolbar);
我的工具栏布局:
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:minHeight="?attr/actionBarSize"
android:theme="@style/DefaultActionBarTheme"
app:popupTheme="@style/ThemeOverlay.AppCompat.Light" />
我的活动中包括:
android:id="@+id/detail_root"
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="match_parent">
android:id="@+id/detail_listview"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:overScrollMode="always" />
DefaultActionBarTheme(在styles.xml中):
#1d7caf