Die Symbolleiste Layout ausrichten I gesetzt android: layout_gravity = "center_vertical" aber es funktioniert nichtAndroid die Navigationsleiste Symbol und Logo kann nicht
Code:
<?xml version="1.0" encoding="utf-8"?>
<android.support.v7.widget.Toolbar
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:id="@+id/toolbar"
android:layout_width="match_parent"
android:layout_height="100dp"
android:background="@drawable/toolbar_bg"
android:fitsSystemWindows="true"
app:popupTheme="@style/Theme.AppCompat.Light.DarkActionBar"
app:theme="@style/ThemeOverlay.AppCompat.Dark.ActionBar">
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:src="@android:drawable/sym_def_app_icon" />
Haupt Layout:
<!-- As the main content view, the view below consumes the entire
space available using match_parent in both dimensions. -->
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="match_parent">
<include
android:id="@+id/head_tool_bar"
layout="@layout/toolbar" />
<FrameLayout
android:id="@+id/container"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_below="@+id/head_tool_bar" />
</RelativeLayout>
<!-- The drawer is given a fixed width in dp and extends the full height of
the container. -->
<fragment
android:id="@+id/navigation_drawer"
android:name="com.voogolf.helper.home.NavigationDrawerFragment"
android:layout_width="@dimen/navigation_drawer_width"
android:layout_height="match_parent"
android:layout_gravity="start"
tools:layout="@layout/drawer_new_home" />
</android.support.v4.widget.DrawerLayout>
Wie kann ich Schubladensymbol und Logo oben ausrichten? Warum links Schublade Symbol Padding haben so?
Was ist das Bild in diesem Bild? –
Es ist besser, wenn Sie diese Elemente in einem relativen oder linearen Layout in der Symbolleiste hinzufügen. –
Ich entferne meine benutzerdefinierte Bildansicht in der Symbolleiste und toolbar.setLogo(), aber das Ergebnis ist das gleiche wie das obige Bild, kann nicht die linke Schublade Symbol Algin, warum? –