Following is the layout of the Toolbar I am using, but I am getting a strange gap towards the left side of the first ImageView (the gap between the left edge of the screen and the right edge of the left-ImageView). The question is why, and how can I get rid of it?
I even tried to set a android:padding="0dp"
to LinearLayout
and a android:layout_margin="0dp"
to the relevant ImageView
, but that doesn't seem to work. I am using Material Design if that matters.
<?xml version="1.0" encoding="utf-8"?>
<android.support.v7.widget.Toolbar xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="#F4FA58"
android:elevation="4dp" >
<LinearLayout
android:id="@+id/appBar_linearLayout"
android:orientation="horizontal"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:radius="25dp"
android:background="#B45F04"
android:padding="0dp" >
<ImageView
android:id="@+id/appBar_imageView"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:src="@drawable/ic_action_back"
android:contentDescription="@string/appBar_imageView_contentDescription"
android:layout_margin="0dp" />
<include
android:id="@+id/appBar_searchView"
layout="@layout/searchview" />
<ImageView
android:id="@+id/appBar_imageViewOne"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:src="@drawable/ic_action_cancel"
android:contentDescription="@string/appBar_imageViewOne_contentDescription" />
</LinearLayout>
</android.support.v7.widget.Toolbar>