-4
为什么在工具栏中的图像不能在中心对齐时删除android中的菜单项。
如果我隐藏了菜单项,标题右移,即在导航图标和标题之间添加了一些空格。工具栏中的标题图像对齐方式android
我的代码
<android.support.v7.widget.Toolbar
android:id="@+id/toolbar"
android:layout_width="match_parent"
android:layout_height="?attr/actionBarSize"
app:contentInsetLeft="0dp"
app:contentInsetStart="0dp"
app:contentInsetRight="0dp"
app:contentInsetStartWithNavigation="0dp"
android:background="#FFF">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
>
<ImageView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="5dp"
android:id="@+id/pg_title"
android:layout_centerHorizontal="true"
android:src="@drawable/logo"
/>
</LinearLayout>
</android.support.v7.widget.Toolbar>
请把你的代码在这里,我们可以看到你在做什么,并能帮助之后你会以更好的方式。 –