lundi 25 mai 2015

Toolbar title disappears when adding views

I just realized that when I add views to the Toolbar in the xml file, the title disappears.

e.g.

<LinearLayout
    xmlns:android="http://ift.tt/nIICcg"
    android:orientation="vertical" android:layout_width="match_parent"
    android:layout_height="match_parent">

    <android.support.v7.widget.Toolbar
        android:id="@+id/activity_taskeditor_toolbar"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:background="?attr/colorPrimary"
        android:elevation="8dp"
        app:theme="@style/ThemeOverlay.AppCompat.Dark.ActionBar"
        >

        <LinearLayout
            android:layout_width="match_parent"
            android:layout_height="wrap_content">

            <EditText
                android:id="@+id/activity_taskeditor_title"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:hint="@string/title"
                android:layout_marginLeft="16dp"
                android:layout_marginRight="16dp"
                android:layout_marginEnd="16dp"
                android:layout_marginStart="16dp"
                android:layout_marginTop="16dp"
                android:textSize="22sp"/>

        </LinearLayout>

    </android.support.v7.widget.Toolbar>
</LinearLayout>

Without the views the title exists, but when adding my views it disappears.

Any idea how to solve this problem?

Thanks in advance

Aucun commentaire:

Enregistrer un commentaire