Hi I am developing small android application in which I am trying to display tool-bar with AppBarLayout
. I want to display some view on top of my tool-bar. I tried this in following way :
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context="com.example.nileshkashid.samplesearchbarapplication.Main2Activity">
<android.support.design.widget.AppBarLayout
android:id="@+id/toolbar_view"
android:layout_width="match_parent"
android:layout_height="wrap_content"
>
<android.support.v7.widget.Toolbar
android:id="@+id/toolbar"
android:layout_width="match_parent"
android:layout_height="?attr/actionBarSize"
android:background="@android:color/transparent"
/>
</android.support.design.widget.AppBarLayout>
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="150dp"
android:background="@android:color/holo_red_dark"
></RelativeLayout>
<RelativeLayout
android:layout_width="150dp"
android:layout_height="150dp"
android:background="@android:color/holo_green_dark"
></RelativeLayout>
</RelativeLayout>
So in above layout later both relative layouts comes under my AppBarLayout
. But I want to show them on top of my toolbar_view
. Am I missing anything or doing something wrong. Need some help. Thank you.