Using material design how to create a toolbar with background image.
the following is what i want:
I am trying the following 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/actionBar"
android:layout_width="match_parent"
android:layout_height="200dp"
app:contentInsetEnd="0dp"
app:contentInsetStart="0dp"
android:minHeight="200dp">
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="@+id/imageViewplaces"
android:src="@drawable/puri"
android:layout_gravity="center"/>
</android.support.v7.widget.Toolbar>
and what i am getting is:
android:layout_width="match_parent"
for ImageView as Toolbar ismatch_parent
so in order to apply image all over Toolbar. You should modify ImageView width tomatch_parent
.wrap_content
will display image width and height according to image provided in ImageView – Ohmage