title: layout XML issues in Android
body: <p>I am trying out a very simple rectangle box with two icons in the center. Strangely they are not coming up properly even after I add gravity etc. Please take a look at the screen shot.</p>
  
  <p><a href="https://i.stack.imgur.com/Qt9Va.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/Qt9Va.png" alt="enter image description here"></a></p>
  
  <p>I am trying center them so that they look perfectly in the center.</p>
  
  <p>Here is the code I am trying out:</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
  &lt;RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
      android:id="@+id/layout_footer"
      android:layout_width="match_parent"
      android:layout_height="?android:attr/actionBarSize"
      android:background="@color/panelcolor"
      android:orientation="horizontal" &gt;
  
  
      &lt;LinearLayout
          android:id="@+id/accountsNameandImage1"
          android:layout_width="wrap_content"
          android:layout_height="match_parent"
          android:layout_centerInParent="true"
          android:gravity="center"&gt;
  
          &lt;ImageView
              android:id="@+id/homeImage"
              android:layout_width="wrap_content"
              android:layout_height="match_parent"
              android:layout_marginBottom="1dp"
              android:src="@drawable/ic_action_home" /&gt;
  
          &lt;TextView
              android:id="@+id/homeName"
              android:layout_width="wrap_content"
              android:layout_height="match_parent"
              android:gravity="center"
              android:text="Home"
              android:textColor="@android:color/white"
              android:textSize="12sp" /&gt;
  
      &lt;/LinearLayout&gt;
  
      &lt;LinearLayout
          android:id="@+id/accountsNameandImage2"
          android:layout_width="wrap_content"
          android:layout_height="match_parent"
          android:layout_toRightOf="@+id/accountsNameandImage1"
          android:orientation="horizontal"
          android:layout_marginLeft="10dp"
          android:layout_centerInParent="true"
          android:gravity="center"&gt;
  
          &lt;ImageView
              android:id="@+id/viewImage"
              android:layout_width="wrap_content"
              android:layout_height="match_parent"
              android:layout_marginBottom="1dp"
              android:src="@drawable/ic_visibility" /&gt;
  
          &lt;TextView
              android:id="@+id/viewName"
              android:layout_width="wrap_content"
              android:layout_height="match_parent"
              android:gravity="center"
              android:text="Viewed"
              android:textColor="@android:color/white"
              android:textSize="12sp" /&gt;
  
      &lt;/LinearLayout&gt;
  
  &lt;/RelativeLayout&gt;
  </code></pre>
  
  <p>What could be wrong here?</p>