title: Android ViewFlipper causes images to not adjust size in table
body: <p>I'm using a TableLayout to create a square gameboard in Android. I want to set the dp of the table's width and height, and have its contents automatically expand and contract to fit the table.</p>
  
  <p>I got this working with the entries in the tableRows as LinearLayouts with a single ImageView inside, but I need to change what images are displayed with click actions, so I thought I would use a ViewFlipper.</p>
  
  <p>Now that I'm using the ViewFlipper, though, my image sizes have gone all wonky. Does anyone know if there's a setting I can set on ViewFlipper to get the images to auto adjust their size in a table?</p>
  
  <p>Here's my xml:</p>
  
  <pre><code>&lt;TableLayout
      android:id="@+id/gameBoard"
      android:layout_width="@dimen/boardWidth"
      android:layout_height="@dimen/boardWidth"
      android:layout_margin="0dp"
      android:padding="0dp"
      android:shrinkColumns="*"
      android:stretchColumns="*" &gt;
  &lt;/TableLayout&gt;
  </code></pre>
  
  <p>And here's the code I'm programmatically creating the table with:</p>
  
  <pre><code>TableLayout gameBoard = (TableLayout) findViewById(R.id.gameBoard);
  TableLayout.LayoutParams rowParams = new TableLayout.LayoutParams(TableLayout.LayoutParams.MATCH_PARENT,TableLayout.LayoutParams.WRAP_CONTENT);
  rowParams.setMargins(0, 0, 0, 0);
  for (int y = settings.getBoardSide() - 1; y &gt; -1; y--) {
      TableRow row = new TableRow(this);
      row.setPadding(0, 0, 0, 0);
  
      for (int x = 0; x &lt; settings.getBoardSide(); x++) {
  
          ViewFlipper flipper = new ViewFlipper(this);
          flipper.setOnClickListener(new TileClick());
  
          //default image
          ImageView cloud = new ImageView(this);
          cloud.setImageResource(R.drawable.transparent_cloud);
          cloud.setAdjustViewBounds(true);
          flipper.addView(cloud, 0);
  
          //second image
          ImageView landscape = new ImageView(this);
          landscape.setImageResource(R.drawable.land_scape);
          landscape.setAdjustViewBounds(true);
          flipper.addView(landscape, 1);
  
          row.addView(flipper);
      }
      gameBoard.addView(row, rowParams);
  }
  </code></pre>