title: Why the layout gravity of TextView is not working in horizontal LinearLayout?
body: <p>This is the code which i am trying. but the textview which has layout_gravity right no shifting to right in horizontal linear layout.</p>
  
  <pre><code>&lt;LinearLayout
              android:layout_width="match_parent"
              android:layout_height="wrap_content"
              android:layout_marginLeft="10dp"
              android:layout_marginRight="10dp"
              android:orientation="horizontal" &gt;
  
              &lt;TextView
                  android:layout_width="wrap_content"
                  android:layout_height="50dp"
                  android:layout_gravity="left"
                  android:gravity="center_vertical"
                  android:text="This Year"
                  android:textColor="@color/gray_dark"
                  android:textSize="18sp" /&gt;
  
              &lt;TextView
                  android:id="@+id/tvHomeIncomeThisYear"
                  android:layout_width="wrap_content"
                  android:layout_height="50dp"
                  android:gravity="center_vertical"
                  android:layout_gravity="right"
                  android:text="$0.00 USD"
                  android:textColor="#000000"
                  android:textSize="18sp" /&gt;
  
          &lt;/LinearLayout&gt;
  </code></pre>