title: ImageView height is always 0
body: <p>I am trying to get the height and width of my imageview so I can scale my image down the the appropriate size but everytime I try to get the height I get the height as 0. I thought maybe it just was not measured yet so I put a <code>onPreDrawListener</code> on the imageview so that I know it would be measured at that time but I still get 0 so I am not sure the problem.</p>
  
  <p>this is my full layout</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
  
  &lt;RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
      android:layout_width="match_parent"
      android:layout_height="match_parent"&gt;
  
      &lt;RelativeLayout
          android:layout_width="match_parent"
          android:layout_height="match_parent"
          android:layout_alignParentTop="true"
          android:layout_alignParentLeft="true"
          android:id="@+id/content"
          android:layout_above="@+id/comment_layout"&gt;
  
          &lt;ImageView
              android:layout_width="match_parent"
              android:layout_height="match_parent"
              android:id="@+id/imageView"/&gt;
  
          &lt;ListView
              android:layout_width="match_parent"
              android:layout_height="match_parent"
              android:id="@+id/comments"
              android:background="@android:color/transparent"/&gt;
  
      &lt;/RelativeLayout&gt;
  
          &lt;RelativeLayout
              android:layout_width="match_parent"
              android:layout_height="wrap_content"
              android:id="@+id/comment_layout"&gt;
  
              &lt;EditText
                  android:layout_width="match_parent"
                  android:layout_height="wrap_content"
                  android:id="@+id/editText"
                  android:layout_alignParentBottom="true"
                  android:layout_toLeftOf="@+id/send_button"/&gt;
  
              &lt;Button
                  android:layout_width="wrap_content"
                  android:layout_height="wrap_content"
                  android:id="@+id/send_button"
                  android:layout_alignParentBottom="true"
                  android:layout_alignParentRight="true"/&gt;
  
          &lt;/RelativeLayout&gt;
  
  &lt;/RelativeLayout&gt;
  </code></pre>
  
  <p>here is where I try to get the height</p>
  
  <pre><code>ViewTreeObserver obs = imageView.getViewTreeObserver();
          if(obs != null){
              obs.addOnPreDrawListener(new ViewTreeObserver.OnPreDrawListener() {
                  @Override
                  public boolean onPreDraw() {
                      if(image != null){
                          imageView.getViewTreeObserver().removeOnPreDrawListener(this);
                          int height = imageView.getHeight(); // 0
                          int width = imageView.getWidth(); // 720
                      }
                      return false;
                  }
              });
          }
  </code></pre>
  
  <p>the width displays 720 but the height always displays 0.</p>
  
  <p>putting in a hard width also has no effect</p>