title: Imageview too small
body: <p>I would like to ask about layout problem for an imageView inside a scrollView.
  However, the image shown out to be very very small. Even for a <code>1024 * 1024 px</code> picture cannot fully occupy the whole screen width of a normal phone.</p>
  
  <p>How could it be amended such that for any image size:</p>
  
  <p>1) The width can be auto scaled up or down to fix with the screen width;</p>
  
  <p>2) The height would be accordingly scaled up or down to maintain the height:width ratio, and could be scrollable if greater than the available space.</p>
  
  <p>I have tried a lot different combinations shown at <a href="http://juliaailse.iteye.com/blog/1409317" rel="nofollow">http://juliaailse.iteye.com/blog/1409317</a> but still fails. </p>
  
  <p>The code is as follows:</p>
  
  <pre><code>&lt;TableLayout android:id="@+id/tableLayout" 
     android:layout_width="match_parent" 
     android:layout_height="match_parent" 
     android:stretchColumns="*" 
     android:background="@color/background_color"
     android:orientation="vertical"  
     xmlns:android="http://schemas.android.com/apk/res/android"&gt;
  
      &lt;TableRow
          android:id="@+id/tableRow0"
          android:layout_width="match_parent"
          android:layout_height="match_parent" &gt;
  
          &lt;Button
            android:id="@+id/RefreshButton"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_gravity="center_vertical"
            android:layout_span="2"
            android:paddingBottom="2dp"
            android:paddingTop="2dp"
            android:text="Refresh"         
            android:textSize="10sp" /&gt;    
  
         &lt;TextView
             android:id="@+id/titleTextView"
             android:layout_width="match_parent"
             android:layout_height="wrap_content"
             android:layout_gravity="center_horizontal"
             android:layout_marginBottom="2dp"
             android:layout_span="4"
             android:gravity="center_horizontal"
             android:text="@string/quiz_title"
             android:textColor="@color/text_color"
             android:textSize="@dimen/title_size" &gt;
         &lt;/TextView&gt;
  
         &lt;Button
            android:id="@+id/BackButton"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_gravity="center_vertical"
            android:layout_span="2"
            android:paddingBottom="2dp"
            android:paddingTop="2dp"
            android:text="Back"
            android:textSize="10sp" /&gt;    
     &lt;/TableRow&gt;
  
      &lt;TableRow
          android:id="@+id/tableRow2"
          android:layout_width="match_parent"
          android:layout_height="match_parent" &gt;
  
         &lt;TextView android:id="@+id/questionNumberTextView"
            android:layout_width="match_parent" 
            android:layout_height="wrap_content"
            android:layout_marginBottom="2dp" 
            android:layout_marginTop="2dp"
            android:layout_span="8"
            android:textColor="@color/text_color" 
            android:textSize="@dimen/text_size" 
            android:layout_gravity="center" 
            android:gravity="center"&gt;        
         &lt;/TextView&gt;      
     &lt;/TableRow&gt;
  
     &lt;TableRow
         android:id="@+id/tableRow3"
         android:layout_width="match_parent"
         android:layout_height="match_parent"
         android:layout_weight="1"
         android:background="@android:color/transparent" &gt;
  
        &lt;ScrollView android:id="@+id/SlotScrollView" 
           android:layout_width="match_parent"  
           android:layout_span="8"&gt;
  
             &lt;ImageView
                 android:id="@+id/flagImageView"
                 android:layout_width="wrap_content"
                 android:layout_height="wrap_content"
                 android:layout_gravity="center"
                 android:gravity="center_horizontal" &gt;      
             &lt;/ImageView&gt;
       &lt;/ScrollView&gt;   
     &lt;/TableRow&gt;   
  
      &lt;TableRow
          android:id="@+id/tableRow4"
          android:layout_width="match_parent"
          android:layout_height="match_parent"
          android:paddingTop="5dp" &gt;
  
         &lt;TextView
             android:id="@+id/guessCountryTextView"
             android:layout_width="wrap_content"
             android:layout_height="wrap_content"
             android:layout_gravity="center_horizontal"
             android:layout_marginBottom="2dp"
             android:layout_marginTop="2dp"
             android:layout_span="8"
             android:gravity="center_horizontal"
             android:text="@string/choose_answer"
             android:textColor="@color/text_color"
             android:textSize="@dimen/text_size" &gt;    
          &lt;/TextView&gt;                       
     &lt;/TableRow&gt;    
  
     &lt;TableRow
         android:id="@+id/tableRow4"
         android:layout_width="match_parent"
         android:layout_height="match_parent"     
         android:background="@android:color/transparent" &gt;  
  
         &lt;TableLayout android:id="@+id/buttonTableLayout" 
            android:layout_width="match_parent"
            android:layout_height="wrap_content" 
            android:layout_span="8"
            android:layout_weight="1" 
            android:stretchColumns="0,1,2,3"&gt;
            &lt;TableRow android:id="@+id/tableRow0" 
               android:layout_width="match_parent" 
               android:layout_height="wrap_content" 
               android:orientation="horizontal"&gt;&lt;/TableRow&gt;
            &lt;TableRow android:id="@+id/tableRow1"
               android:layout_width="match_parent" 
               android:layout_height="wrap_content"
               android:orientation="horizontal"&gt;&lt;/TableRow&gt;
            &lt;TableRow android:id="@+id/tableRow2"
               android:layout_width="match_parent" 
               android:layout_height="wrap_content"
               android:orientation="horizontal"&gt;&lt;/TableRow&gt;
         &lt;/TableLayout&gt;
      &lt;/TableRow&gt;
  
     &lt;TableRow
         android:id="@+id/tableRow5"
         android:layout_width="match_parent"
         android:layout_height="match_parent"
         android:background="@android:color/transparent"
         android:gravity="center_horizontal" &gt;
  
         &lt;TextView android:id="@+id/answerTextView"
            android:layout_width="match_parent" 
            android:layout_height="wrap_content"
            android:layout_span="8"
            android:textSize="@dimen/answer_size" 
            android:layout_gravity="center" 
            android:textStyle="bold" 
            android:gravity="center"&gt;        
         &lt;/TextView&gt;
      &lt;/TableRow&gt;         
  
  &lt;/TableLayout&gt;   
  </code></pre>