how works TableLayout, Table Row
<p>I have a TableLayout filled programmatically during scroll a cursor.<br>
I create, every cursor step, 3 item : TextView, ImageView and TextView.<br>
The problem is for ImageView.  </p>

<p>On ImageView I wanna draw a ShapeDrawable<br>
(for that I have override a View like 
<a href="http://developer.android.com/guide/topics/graphics/2d-graphics.html" rel="nofollow">2D Graphics - Shape Drawable</a></p>

<p>On ImageView I set a background resource<br>
(for apply shape properties) with drawable xml file.<br>
For that I wanna height differ from other TextView on the same TableRow.</p>

<p>I tried various combination (setting LayoutParams, gravity, layout_weight) without success.
The result is always the same :<br>
then ImageView take the same height of TableRow !</p>

<p>Here some pieces of code:
    </p>

<pre><code>TableLayout tl = (TableLayout)findViewById(R.id.list_show_stats);
tl.setColumnStretchable(1, true);
tl.setColumnShrinkable(0, true);

for every cursor step
  TableRow tr = new TableRow(this);
  TableRow.LayoutParams tr_lp = new TableRow.LayoutParams(LayoutParams.FILL_PARENT,LayoutParams.WRAP_CONTENT);
  tr.setLayoutParams(tr_lp);
  tr.setBaselineAligned(true);

  TextView tv1 = new TextView(this);
  LayoutParams tv1lp = new TableRow.LayoutParams(LayoutParams.FILL_PARENT,LayoutParams.FILL_PARENT, 1L);
  tv1lp.column = 0;
  tv1lp.gravity = Gravity.LEFT|Gravity.CENTER_VERTICAL;
  tv1.setLayoutParams(tv1lp);
  tv1.setText(" description ");

  ImageView img = new ImageView(this);
  CustomImgBarDrawableView dw = new CustomImgBarDrawableView(this, width, height);
  img.setImageDrawable(dw.mDrawable);
  LayoutParams lp = new TableRow.LayoutParams(LayoutParams.FILL_PARENT,LayoutParams.FILL_PARENT, 1L);
  lp.gravity = Gravity.LEFT;
  lp.column = 1;
  img.setLayoutParams(lp);
  img.setBackgroundResource(R.drawable.layout_showbar);

  TextView tv2 = new TextView(this);
  LayoutParams tv2lp = new TableRow.LayoutParams(LayoutParams.FILL_PARENT,LayoutParams.FILL_PARENT, 1L);
  tv2lp.column = 2;
  tv2lp.gravity = Gravity.RIGHT|Gravity.CENTER_VERTICAL|Gravity.FILL_HORIZONTAL;
  tv2.setLayoutParams(tv2lp);
  tv2.setText(" value ");

  tr.addView(tv1);
  tr.addView(img);
  tr.addView(tv2);
  tl.addView(tr,new TableLayout.LayoutParams(LayoutParams.FILL_PARENT,LayoutParams.WRAP_CONTENT))




public class CustomImgBarDrawableView extends View {
  private ShapeDrawable mDrawable;
  public CustomImgBarDrawableView(Context context, int w, int h) {
    super(context);
    mDrawable = new ShapeDrawable(new RectShape());
    mDrawable.setIntrinsicHeight(h);
    mDrawable.setIntrinsicWidth(w);
  }
  protected void onDraw(Canvas canvas) {
    mDrawable.draw(canvas);
  }
}
</code></pre>

<p>Someone can help me, please ?
Thanks in advantage.</p>
