title: toolbar background doesn't adjust and title is not shown - android
body: <p>I'm trying to create a toolbar that uses a background I made in a png file.
  Now, when I use the background in the xml, the layout editor in the android studio shows exactly the expected result. The problem comes when I run the app in the virtual device. The background doesn't adjust to the toolbar and as a result only a part of it gets shown.</p>
  
  <p>Moreover, the title and the items are acting strange. The title is not shown at all and the only item that is displayed in the toolbar suddenly jumps to the left.</p>
  
  <p>XML Code of the Toolbar:</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
  &lt;android.support.design.widget.AppBarLayout xmlns:android="http://schemas.android.com/apk/res/android"
      android:id="@+id/app_bar_styled"
      android:layout_width="match_parent"
      android:layout_height="wrap_content"
      android:clipToPadding="false"
      android:elevation="15dp"&gt;
  
      &lt;android.support.v7.widget.Toolbar
          android:id="@+id/toolbar_styled"
          android:layout_width="match_parent"
          android:layout_height="?attr/actionBarSize"
          android:elevation="15dp"
          android:theme="@style/AppTheme.AppBarOverlay.Styled"&gt;
          &lt;ImageView
              android:layout_width="match_parent"
              android:layout_height="match_parent"
              android:src="@drawable/action_bar_background"/&gt;
      &lt;/android.support.v7.widget.Toolbar&gt;
  &lt;/android.support.design.widget.AppBarLayout&gt;
  </code></pre>
  
  <p>XML Code for the style of the toolbar:</p>
  
  <pre><code>&lt;style name="AppTheme.AppBarOverlay.Styled" parent="ThemeOverlay.AppCompat.Dark.ActionBar"&gt;
          &lt;item name="android:background"&gt;@drawable/action_bar_background&lt;/item&gt;
          &lt;item name="android:titleTextStyle"&gt;@style/ToolBarTitleStyle&lt;/item&gt;
      &lt;/style&gt;
  &lt;style name="ToolBarTitleStyle" parent="Base.TextAppearance.AppCompat"&gt;
          &lt;item name="android:textColor"&gt;@android:color/white&lt;/item&gt;
          &lt;item name="android:textStyle"&gt;bold&lt;/item&gt;
          &lt;item name="android:textSize"&gt;16dp&lt;/item&gt;
      &lt;/style&gt;
  </code></pre>
  
  <p>And this is the MainActivity code which concerns the toolbar:</p>
  
  <pre><code>toolbar = (Toolbar) findViewById(R.id.toolbar_styled);
  toolbar.setTitle(R.string.app_name);
  
  setSupportActionBar(toolbar);
  getSupportActionBar().setDisplayHomeAsUpEnabled(true);
  getSupportActionBar().setDisplayShowTitleEnabled(true);
  </code></pre>
  
  <p>Here is the images of the layout editor preview and the virtual device:</p>
  
  <p>Layout Editor : <a href="https://i.gyazo.com/2b01f5ef9c87ecb35a605aa150aa6ad5.png" rel="nofollow noreferrer">https://i.gyazo.com/2b01f5ef9c87ecb35a605aa150aa6ad5.png</a></p>
  
  <p>Virtual Device: <a href="https://i.gyazo.com/5bbd9bf5a2df1727278ba9e78efd622b.png" rel="nofollow noreferrer">https://i.gyazo.com/5bbd9bf5a2df1727278ba9e78efd622b.png</a></p>