How to customize an android toolbar?

3

How do I add more buttons to my toolbar?

    
asked by anonymous 29.12.2016 / 20:55

1 answer

1

I've got it so see if that's what you want.

<android.support.design.widget.AppBarLayout
    android:id="@+id/appbar"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:theme="@style/AppTheme.AppBarOverlay">

    <android.support.v7.widget.Toolbar
        android:id="@+id/toolbar"
        android:layout_width="match_parent"
        android:layout_height="?attr/actionBarSize"
        android:background="?attr/colorPrimary"
        app:layout_scrollFlags="scroll|enterAlways"
        app:popupTheme="@style/AppTheme.PopupOverlay">

        <Spinner
            android:layout_gravity="left"
            android:id="@+id/spinnerBar"
            android:layout_width="wrap_content"
            android:layout_height="match_parent" />

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

</android.support.design.widget.AppBarLayout>

<LinearLayout
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    app:layout_behavior="@string/appbar_scrolling_view_behavior">


</LinearLayout>

    
12.01.2017 / 13:32