title: Linear Layout Horizontal, Gravity Problems
body: <p>I've placed three buttons as below,</p>
  
  <pre><code>&lt;LinearLayout
      android:layout_width="match_parent"
      android:layout_height="match_parent"
      android:orientation="vertical"&gt;
  
      &lt;LinearLayout
          android:layout_width="match_parent"
          android:layout_height="wrap_content"
          android:orientation="horizontal"
          android:layout_marginTop="8dp"
          android:layout_marginBottom="8dp"
          android:layout_gravity="center"&gt;
  
          &lt;Button
              android:layout_width="wrap_content"
              android:layout_height="wrap_content"
              android:text="Standard"
              android:id="@+id/standard_map"/&gt;
          &lt;Button
              android:layout_width="wrap_content"
              android:layout_height="wrap_content"
              android:text="satellite"
              android:id="@+id/satellite"/&gt;
          &lt;Button
              android:layout_width="wrap_content"
              android:layout_height="wrap_content"
              android:text="Hybrid"
              android:id="@+id/hybrid"/&gt;
      &lt;/LinearLayout&gt;
  
      &lt;fragment
          xmlns:android="http://schemas.android.com/apk/res/android"
          android:id="@+id/map"
          android:layout_width="match_parent"
          android:layout_height="match_parent"
          android:name="com.google.android.gms.maps.MapFragment"
          map:cameraTargetLat="13.0827"
          map:cameraTargetLng="80.2707"
          map:cameraBearing="112.5"
          map:cameraTilt="65"
          map:cameraZoom="20"/&gt;
  
  &lt;/LinearLayout&gt;
  </code></pre>
  
  <p>The output yield is as below:
  <a href="https://i.stack.imgur.com/kryL9.png" rel="nofollow noreferrer">image explaining the problem</a></p>
  
  <p>The orientation of the inner Linear Layout is horizontal and that's perfectly fine. I need the buttons to be aligned in centre (Vertically centred). Even when I use <code>android:gravity="centre"</code>, it aligns the buttons horizontally centred which is of no use. <strong>I need the buttons to be vertically centred in an Horizontal Linear Layout.</strong></p>