我有工具栏与图像作为标识,徽标居中。但是当我放置导航抽屉时,由于存在导航抽屉按钮,徽标向右移动。如何使徽标始终以工具栏中的导航抽屉按钮为中心?安卓工具栏图像居中与导航抽屉按钮
谢谢。
我的代码
<android.support.design.widget.AppBarLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:theme="@style/ThemeOverlay.AppCompat.Dark.ActionBar">
<android.support.v7.widget.Toolbar
android:id="@+id/toolbar"
android:layout_width="match_parent"
android:layout_height="?attr/actionBarSize"
android:background="?attr/colorPrimary"
app:popupTheme="@style/ThemeOverlay.AppCompat.Light">
<ImageView
android:layout_width="match_parent"
android:layout_height="25dp"
android:src="@drawable/logo"/>
</android.support.v7.widget.Toolbar>
<android.support.design.widget.TabLayout
android:id="@+id/tabs"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="?attr/colorPrimaryDark"
app:tabGravity="fill"
app:tabMode="fixed" />
</android.support.design.widget.AppBarLayout>
发表您的醋栗输出的图像 –