title: Android: Set ImageView layout_height programmatically
body: <p>I have an ImageView in my main.xml file:</p>
  
  <pre><code>&lt;ImageView
              android:id="@+id/pageImage"
              android:layout_width="270dp"
              android:layout_height="45dp"
              android:layout_alignParentLeft="true"
              android:layout_alignParentTop="true"
              android:layout_marginLeft="25dp"
              android:layout_marginTop="15dp"
              android:scaleType="fitXY"
              android:src="@drawable/pageimage" /&gt;
  </code></pre>
  
  <p>What I only need to do is to set the the <code>layout_height</code> programmatically to another value.</p>
  
  <p>Additionally, I need to set the value in <strong>dp</strong>. So it is currently 45dp, I'd like to change it to another value in my main activity.</p>
  
  <p>I tried to figure out how to do this using LayoutParams, but I couldn't succeed.</p>
  
  <p>Thanks.</p>