I have two buttons on the toolbar which are not obeying the "wrap_content" layout_width directive. I have added green and red background colors to make their true widths apparent in the screenshot. I have padding set to 0dp and also no margins. I have looked in my brief styles.xml and see nothing relevant, and I haven't noticed anywhere else in the app which this is happening. Any tips would be appreciated.
Thanks.
<android.support.v7.widget.Toolbar
android:id="@+id/pdf_renderer_toolbar"
android:layout_alignParentTop="true"
android:layout_width="match_parent"
android:layout_height="?attr/actionBarSize"
android:background="@color/primaryColor"
android:theme="@style/MyStyle"
app:layout_scrollFlags="scroll|enterAlways"
app:titleTextAppearance="@style/Toolbar.TitleText"
app:popupTheme="@style/ThemeOverlay.AppCompat.Light" >
<Button
android:layout_width="wrap_content"
android:layout_height="50dp"
android:text="Docs"
android:layout_gravity="right"
android:layout_marginRight="0dp"
android:padding="0dp"
android:background="@color/green_button_color"
android:textColor="@color/solid_white"
android:textSize="18sp"
android:id="@+id/pdf_docs_button"
android:textAllCaps="false"
style="?android:attr/borderlessButtonStyle"
/>
<Button
android:layout_width="wrap_content"
android:layout_height="50dp"
android:text="Edit"
android:layout_gravity="right"
android:padding="0dp"
android:layout_marginRight="0dp"
android:background="@color/red_button_color"
android:textColor="@color/solid_white"
android:textSize="18sp"
android:id="@+id/pdf_edit_button"
android:textAllCaps="false"
style="?android:attr/borderlessButtonStyle"
/>
</android.support.v7.widget.Toolbar>