If I have a TableLayout structure such as below which defines an
ImageView width/height, then I see the expected result:

<TableLayout android:layout_width="wrap_content"
android:layout_height="wrap_content">
        <TableRow>
                <ImageView android:src="@drawable/pic1" 
android:layout_width="50px"
android:layout_height="50px" />
                <ImageView android:src="@drawable/pic2"
android:layout_width="wrap_content"
android:layout_height="wrap_content" />
        </TableRow>
</TableLayout>

I need to do the above programmatically so...

TableLayout tableLayout = new TableLayout(ctx);
TableRow tableRow = new TaleRow(ctx);

imageViewOne = new ImageView(ctx);
imageViewTwo = new ImageView(ctx);
imageViewOne .setImageResource(R.drawable.pic1);
imageViewTwo.setImageResource(R.drawable.pic2);

imageViewOne.setLayoutParams(new LayoutParams(50, 50));

rootView.addView(tableLayout);
tableLayout.addView(tableRow);
tableRow.addView(imageViewOne);
tableRow.addView(imageViewTwo);

... The above shows pic2, but pic1 dissapears completely.

What am I missing here?

Thanks!
Eurig Jones

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

Reply via email to