I use android.support.v7.widget.Toolbar in my activity.
I added it to my layout for the action as follows:
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="match_parent">
<android.support.v7.widget.Toolbar
android:id="@+id/add_contact_toolbar"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignParentTop="true"
android:background="@color/colorPrimary"
android:elevation="6dp"
android:title="@string/add_contact_toolbar_title"
android:popupTheme="@style/ThemeOverlay.AppCompat.Light"
android:theme="@style/ThemeOverlay.AppCompat.Dark.ActionBar"/>
</RelativeLayout>
I am inflating the options menu in onCreateOptionsMenu activity, and I am inflating my menu.xml:
<menu
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto">
<item
android:id="@+id/add_contact_optionmenu_save"
android:title="@string/add_contact_optionmenu_save"
app:showAsAction="always"/>
</menu>
But, unfortunately, the element looks too far to the right and too small:
How can I make it appear, as in all other applications? More, and with more right border?
Hurrah!
source
share