title: Gravity in LinearLayout - android?
body: <p>I created bellow Layout :</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
  &lt;RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
      xmlns:app="http://schemas.android.com/apk/res-auto"
      xmlns:tools="http://schemas.android.com/tools"
      android:id="@+id/relativeStart"
      android:layout_width="match_parent"
      android:layout_height="match_parent"
      android:background="@drawable/back"
      tools:context=".SongsActivity"&gt;
  
      &lt;LinearLayout
          android:layout_width="match_parent"
          android:layout_height="match_parent"
          android:background="@drawable/header"
          android:orientation="vertical"&gt;
  
          &lt;LinearLayout
              android:layout_width="match_parent"
              android:layout_height="0dp"
              android:layout_weight="1"
              android:orientation="horizontal"&gt;
  
              &lt;ImageButton
                  android:layout_width="wrap_content"
                  android:layout_height="wrap_content"
                  android:background="@null"
                  android:src="@drawable/felesh_m" /&gt;
  
              &lt;LinearLayout
                  android:layout_width="wrap_content"
                  android:layout_height="match_parent"
                  android:layout_gravity="center_horizontal|center_vertical"
                  android:gravity="center_horizontal|center_vertical"
                  android:orientation="vertical"&gt;
  
                  &lt;ImageButton
                      android:id="@+id/imbCenter"
                      android:layout_width="wrap_content"
                      android:layout_height="wrap_content"
                      android:layout_gravity="center_horizontal|center_vertical"
                      android:background="@null"
                      android:src="@drawable/hosein_hlarge" /&gt;
              &lt;/LinearLayout&gt;
  
              &lt;ImageButton
                  android:layout_width="wrap_content"
                  android:layout_height="wrap_content"
                  android:background="@null"
                  android:src="@drawable/felesh_m" /&gt;
          &lt;/LinearLayout&gt;
  
          &lt;android.support.v7.widget.RecyclerView
              android:layout_width="match_parent"
              android:layout_height="0dp"
              android:layout_weight="4" /&gt;
      &lt;/LinearLayout&gt;
  &lt;/RelativeLayout&gt;
  </code></pre>
  
  <p>See bellow Image :</p>
  
  <p><a href="https://i.stack.imgur.com/b2kYF.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/b2kYF.png" alt="enter image description here"></a></p>