Android 无法将工具栏中的文本与溢出菜单对齐

Android 无法将工具栏中的文本与溢出菜单对齐,android,xml,Android,Xml,请注意,我使用的是“?attr/actionBarSize”,而不是像许多其他答案所提到的android:“?attr/actionBarSize”。我仍然无法解决这个问题 这是它的样子 试试这个,对我有用 <android.support.v7.widget.Toolbar android:id="@+id/toolbar" android:layout_width="match_parent" android:layout_height="?attr/actio

请注意,我使用的是
“?attr/actionBarSize”
,而不是像许多其他答案所提到的
android:“?attr/actionBarSize”
。我仍然无法解决这个问题

这是它的样子


试试这个,对我有用

<android.support.v7.widget.Toolbar
    android:id="@+id/toolbar"
    android:layout_width="match_parent"
    android:layout_height="?attr/actionBarSize"
    android:background="@color/blue_grey_900"
    app:theme="@style/ThemeOverlay.AppCompat.Dark.ActionBar"
    android:elevation="5dp"/>


这是来自官方博客的,请参见。您可以发布一张图片来描述您想要的结果吗?
<android.support.v7.widget.Toolbar xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/toolbar"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="?attr/colorPrimary"
android:minHeight="?attr/actionBarSize" />