Android – image in appbarlayout

What I want to achieve is almost the same as the result on the image, but there is no folding and label layout under the toolbar text. I completed it with collapsingtollbarlayout, but if I don't want it to crash, I don't think it's a good method. How should I implement the image correctly, so it's under the toolbar and label layout?

resolvent:

OK, here's the solution:

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

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

        <ImageView
            android:id="@+id/imageViewplaces"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:adjustViewBounds="true"
            android:src="@drawable/pyrros" />

        <android.support.design.widget.TabLayout
            android:id="@+id/caj_tab_layout"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:layout_alignBottom="@id/imageViewplaces"
            android:elevation="6dp"
            android:minHeight="?attr/actionBarSize"
            app:tabTextAppearance="@style/mineCustomTabText"
            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"
            app:popupTheme="@style/AppTheme.PopupOverlay"
            android:layout_marginTop="12dp"
            app:titleTextAppearance="@style/Toolbar.TitleText" />

    </RelativeLayout>


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

The content of this article comes from the network collection of netizens. It is used as a learning reference. The copyright belongs to the original author.
THE END
分享
二维码
< <上一篇
下一篇>>