Hi all
I'm trying to put an image multiple times and on multiple lines.
What i want to do is similar to a matrix, where each cell is an
istance of my image.
Here's my code:
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
mLinearLayout = new LinearLayout(this);
for (int i = 0; i < 10; i++) {
ImageView image = new ImageView(this);
image.setImageResource(R.drawable.icon);
image.setAdjustViewBounds(true);
image.setLayoutParams(new
Gallery.LayoutParams(LayoutParams.WRAP_CONTENT,
LayoutParams.WRAP_CONTENT));
mLinearLayout.addView(image);
}
setContentView(mLinearLayout);
}
But my last image shrinks and I got them only on one line.
Am I missing something?
--
You received this message because you are subscribed to the Google
Groups "Android Beginners" group.
NEW! Try asking and tagging your question on Stack Overflow at
http://stackoverflow.com/questions/tagged/android
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-beginners?hl=en