title: Right-align imageView of a LinearLayout
body: <p>How do I rightalign an imageview in a linearlayout - that is put the imageview to the right side of the linearlayout parent? android:layout_alignparent is not allowed in a LinearLayout. And I have tried with different gravity-constants. </p>
  
  <p>This is a depiction of the screen and where I want to position the imageview. Its assumed that the parent is a linearlayout and orients its child in a horizontal order. </p>
  
  <pre><code>______________________
  |                    |                  
  |                    |
  |                   X|
  |                    |
  |                    |
  |                    |
  |                    |
  |                    |
  |                    |
  |                    |
  |                    |
  |                    |    
  |                    |
  |                    |
  |                    |
  |____________________|
  
  
  &lt;LinearLayout 
          android:orientation="horizontal" 
          android:layout_width="match_parent"
          android:layout_marginTop="10dp"
          android:layout_height="0dp"
          android:layout_weight="1" &gt;
  
          &lt;ImageView 
              android:id="@+id/dateImg"
              android:layout_width="60dp"
              android:layout_height="64dp"
              android:layout_marginLeft="8dp"
              android:layout_gravity="end"
              android:src="@drawable/unchecked"/&gt;
  &lt;/LinearLayout&gt;
  </code></pre>