title: Actionbar using customview and menuitems
body: <pre><code>ActionBar actionBar = getActionBar();
  actionBar.setDisplayOptions(ActionBar.DISPLAY_SHOW_CUSTOM); 
  actionBar.setCustomView(R.layout.myLayout);
  
  ...
  
  @Override
  public boolean onCreateOptionsMenu(Menu menu)
  {
      getMenuInflater().inflate(R.menu.myMenu, menu);
  
      menuBar = menu;
  
      return true;
  }
  </code></pre>
  
  <p>myLayout.xml</p>
  
  <pre><code>&lt; RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
  android:layout_width="match_parent"
  android:layout_height="match_parent" &gt;
  
   &lt;ImageView
      android:layout_width="40dp" 
      android:layout_height="40dp"
      android:layout_centerInParent="true"
      android:src="@drawable/myImage" /&gt;
  &lt;/RelativeLayout&gt;
  </code></pre>
  
  <p>myMenu.xml</p>
  
  <pre><code>&lt;menu xmlns:android="http://schemas.android.com/apk/res/android" &gt;
  &lt;item
      android:id="@+id/menuItem1"
      android:icon="@drawable/icon1"
      android:showAsAction="always"
      android:visible="false"
      android:title="@string/menu1"&gt;
  &lt;/item&gt;
  &lt;item
      android:id="@+id/menuItem2"
      android:icon="@drawable/icon2"
      android:showAsAction="always"
      android:title="@string/menu2"&gt;
  &lt;/item&gt;
  
  &lt;/menu&gt;
  </code></pre>
  
  <p>I have a custom view which I use to place an image in the center of the <code>ActionBar</code>. However, when I put the <code>MenuItem</code>s on the <code>ActionBar</code>, the image gets pushed to the left. I don't know how to center the image or fill the <code>RelativeLayout</code> to take the entire <code>ActionBar</code> width. I tried many different things but so far I had no luck. Any help would be appreciated.</p>