I would create LayoutParams to do this.
This or this might be helpful.
Edited, more detail:
LayoutParams params = new LayoutParams(LayoutParams.MATCH_PARENT, LayoutParams.WRAP_CONTENT);
ImageView iv = new ImageView(this);
iv.setImageBitmap(myBitmap);
iv.setLayoutParams(params);
customView.addView(iv);