title: Alignment in custom Action bar
body: <p>I have created a custom action bar </p>
  
  <pre><code>ActionBar actionBar = getActivity().getActionBar();
      actionBar.setCustomView(R.layout.action_bar_draft);
      actionBar.setDisplayShowCustomEnabled(true);
      actionbarFeed = (TextView) actionBar.getCustomView().findViewById(R.id.textView_blogtest);  
      actionbarFeed.setText("My Photos and videos");
  </code></pre>
  
  <p>The problem is Text View is not align center</p>
  
  <p><a href="https://i.stack.imgur.com/8d3ds.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/8d3ds.png" alt="enter image description here"></a></p>
  
  <p>In my layout the text view is at center. when it come to action bar it is shifted to right side.</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;RelativeLayout
      android:id="@+id/relativeLayout1"
      android:layout_width="match_parent"
      android:layout_height="wrap_content"
      android:layout_centerInParent="true" &gt;
  
      &lt;TextView
          android:id="@+id/textView_blogtest"
          android:layout_width="wrap_content"
          android:layout_height="wrap_content"
          android:layout_centerInParent="true"
          android:text="Medium Text"
          android:textAppearance="?android:attr/textAppearanceMedium"
          android:textColor="#000" /&gt;
  &lt;/RelativeLayout&gt;
  </code></pre>
  
  <p></p>
  
  <pre><code> &lt;style name="AppTheme.ActionBarStyle" parent="@style/Widget.Sherlock.ActionBar.Solid"&gt;
      &lt;item name="android:icon"&gt;@drawable/menu&lt;/item&gt;
      &lt;item name="android:background"&gt;#ffca36&lt;/item&gt;
      &lt;item name="background"&gt;#f66605&lt;/item&gt;
      &lt;item name="android:customNavigationLayout"&gt;@layout/action_bar&lt;/item&gt;
  &lt;/style&gt;
  </code></pre>