I have an Activity with a custom Toolbar:
<android.support.v7.widget.Toolbar
android:id="@+id/toolbar"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="?attr/colorPrimary"
android:elevation="4dp"
android:theme="@style/AppTheme"
app:contentInsetStart="0dp"
app:popupTheme="@style/Theme.AppCompat.Light.DarkActionBar">
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:paddingBottom="8dp"
android:paddingLeft="8dp"
android:paddingRight="8dp"
android:paddingTop="8dp">
< !-- More content, including search box -->
</RelativeLayout>
</android.support.v7.widget.Toolbar>
It looks like this in the preview:
But it looks like this on the device:
It seems like the overflow menu is changing the layout. Is there any way around this?


(Integer.MAX_VALUE)?