title: imageswitcher fills screen (but I dont want it to do that) [android]
body: <p>I have added an imageswitcher to my register fragment, when the user select his/her gender the image changes but the image shown is too big and I cant scale it. I am using a scrollview and it is not good that the Imageswitcher is bigger than screen. I tried using smaller images but the result is same. Here is my XML:</p>
  
  <pre><code>&lt;ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
      android:layout_width="fill_parent"
      android:layout_height="wrap_content"
      android:background="@drawable/registerbackground"
      android:fillViewport="true" &gt;
  
      &lt;LinearLayout
          android:layout_width="match_parent"
          android:layout_height="wrap_content"
          android:orientation="vertical" &gt;
  
          &lt;LinearLayout
              android:layout_width="match_parent"
              android:layout_height="wrap_content"
              android:layout_marginTop="20dp"
              android:gravity="center"
              android:orientation="horizontal" &gt;
  
              &lt;TextView
                  android:id="@+id/kayit_kayit"
                  android:layout_width="wrap_content"
                  android:layout_height="wrap_content"
                  android:text="@string/register"
                  android:textColor="#FFFFFFFF"
                  android:textSize="20sp" /&gt;
          &lt;/LinearLayout&gt;
  
          &lt;LinearLayout
              android:layout_width="match_parent"
              android:layout_height="wrap_content"
              android:layout_marginTop="10dp"
              android:gravity="center"
              android:orientation="horizontal" &gt;
  
              &lt;EditText
                  android:id="@+id/kayit_ad"
                  android:layout_width="fill_parent"
                  android:layout_height="fill_parent"
                  android:layout_marginLeft="50dp"
                  android:layout_marginRight="50dp"
                  android:hint="@string/hintAd"
                  android:inputType="textNoSuggestions"
                  android:textColor="#FFFFFFFF" /&gt;
          &lt;/LinearLayout&gt;
  
          &lt;LinearLayout
              android:layout_width="match_parent"
              android:layout_height="wrap_content"
              android:gravity="center"
              android:orientation="horizontal" &gt;
  
              &lt;EditText
                  android:id="@+id/kayit_soyad"
                  android:layout_width="fill_parent"
                  android:layout_height="fill_parent"
                  android:layout_marginLeft="50dp"
                  android:layout_marginRight="50dp"
                  android:hint="@string/hintSoyad"
                  android:inputType="textNoSuggestions"
                  android:textColor="#FFFFFFFF" /&gt;
          &lt;/LinearLayout&gt;
  
          &lt;LinearLayout
              android:layout_width="match_parent"
              android:layout_height="wrap_content"
              android:gravity="center"
              android:orientation="horizontal" &gt;
  
              &lt;EditText
                  android:id="@+id/kayit_email"
                  android:layout_width="fill_parent"
                  android:layout_height="fill_parent"
                  android:layout_marginLeft="50dp"
                  android:layout_marginRight="50dp"
                  android:hint="@string/hintEmail"
                  android:inputType="textEmailAddress"
                  android:textColor="#FFFFFFFF" /&gt;
          &lt;/LinearLayout&gt;
  
          &lt;LinearLayout
              android:layout_width="match_parent"
              android:layout_height="wrap_content"
              android:gravity="center"
              android:orientation="horizontal" &gt;
  
              &lt;RadioGroup
                  android:id="@+id/radioGroup1"
                  android:layout_width="wrap_content"
                  android:layout_height="wrap_content"
                  android:orientation="horizontal" &gt;
  
                  &lt;RadioButton
                      android:id="@+id/radio0"
                      android:layout_width="wrap_content"
                      android:layout_height="wrap_content"
                      android:checked="false"
                      android:text="@string/kayitKiz"
                      android:textColor="#FFFFFFFF" /&gt;
  
                  &lt;RadioButton
                      android:id="@+id/radio1"
                      android:layout_width="wrap_content"
                      android:layout_height="wrap_content"
                      android:checked="false"
                      android:text="@string/kayitErkek"
                      android:textColor="#FFFFFFFF" /&gt;
  
              &lt;/RadioGroup&gt;
  
          &lt;/LinearLayout&gt;
  
          &lt;LinearLayout 
              android:layout_width="match_parent"
              android:layout_height="wrap_content"
              android:gravity="center"
              android:orientation="horizontal"&gt;
  
              &lt;ImageSwitcher    
                  android:id="@+id/cinsiyetSwitcher"
                  android:layout_width="fill_parent"
                  android:layout_height="wrap_content"&gt;
  
              &lt;/ImageSwitcher&gt;
  
          &lt;/LinearLayout&gt;
  
          &lt;LinearLayout 
              android:layout_width="match_parent"
              android:layout_height="wrap_content"
              android:gravity="center"
              android:orientation="horizontal"&gt;
  
              &lt;EditText 
                  android:id="@+id/kayit_kelime1"
                  android:layout_width="wrap_content"
                  android:layout_height="wrap_content"
                  android:layout_weight="1"
                  android:layout_marginLeft="50dp"
                  android:hint="@string/hintKelimeler1"
                  android:inputType="textNoSuggestions"
                  android:textColor="#FFFFFFFF"/&gt;
  
              &lt;EditText 
                  android:id="@+id/kayit_kelime2"
                  android:layout_width="wrap_content"
                  android:layout_height="wrap_content"
                  android:layout_weight="1"
                  android:hint="@string/hintKelimeler2"
                  android:inputType="textNoSuggestions"
                  android:textColor="#FFFFFFFF"/&gt;
  
              &lt;EditText 
                  android:id="@+id/kayit_kelime3"
                  android:layout_width="wrap_content"
                  android:layout_height="wrap_content"
                  android:layout_weight="1"
                  android:layout_marginRight="50dp"
                  android:hint="@string/hintKelimeler3"
                  android:inputType="textNoSuggestions"
                  android:textColor="#FFFFFFFF"/&gt;
  
          &lt;/LinearLayout&gt;
  
  
  
      &lt;/LinearLayout&gt;
  
  &lt;/ScrollView&gt;
  </code></pre>
  
  <p>and the code for the imageswitcher:</p>
  
  <pre><code>....
  
  cinsiyetSwitcher = (ImageSwitcher) rootView.findViewById(R.id.cinsiyetSwitcher);
              cinsiyetSwitcher.setFactory(new ViewFactory() {
  
                     @Override
                     public View makeView() {
                         ImageView imageView = new ImageView(getActivity());
                         imageView.setScaleType(ImageView.ScaleType.CENTER);
                         imageView.setLayoutParams(new ImageSwitcher.LayoutParams(LayoutParams.FILL_PARENT,LayoutParams.FILL_PARENT));
                         return imageView;
                         }
  
                     });
  
              kizRadio = (RadioButton) rootView.findViewById(R.id.radio0);
              erkekRadio = (RadioButton) rootView.findViewById(R.id.radio1);
  
              kizRadio.setOnClickListener( new View.OnClickListener() {
                      public void onClick(View v)
                      {
                          degistir1(v);
                      }
              });
  
              erkekRadio.setOnClickListener( new View.OnClickListener() {
                  public void onClick(View v)
                  {
                      degistir2(v);
                  }
              });
  
  ....
  </code></pre>
  
  <p>...</p>
  
  <pre><code>public void degistir1(View view)
  {
        Animation in = AnimationUtils.loadAnimation(getActivity(),
        android.R.anim.slide_in_left);
        Animation out = AnimationUtils.loadAnimation(getActivity(),
        android.R.anim.slide_out_right);
        cinsiyetSwitcher.setInAnimation(in);
        cinsiyetSwitcher.setOutAnimation(out);
        cinsiyetSwitcher.setImageResource(R.drawable.kari);
  }
  
  public void degistir2(View view)
  {
        Animation in = AnimationUtils.loadAnimation(getActivity(),
        android.R.anim.slide_out_right);
        Animation out = AnimationUtils.loadAnimation(getActivity(),
        android.R.anim.slide_in_left);
        cinsiyetSwitcher.setInAnimation(out);
        cinsiyetSwitcher.setOutAnimation(in);
        cinsiyetSwitcher.setImageResource(R.drawable.adam);
  }
  </code></pre>