LinearLayout is only one direction... everything shows up in a linear order, either horizontally or vertically. ---------------------------------------------------------------------- There are only 10 types of people in the world... Those who know binary and those who don't. ----------------------------------------------------------------------
On Sat, Mar 13, 2010 at 4:19 AM, Luca <[email protected]> wrote: > 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]<android-beginners%[email protected]> > For more options, visit this group at > http://groups.google.com/group/android-beginners?hl=en -- 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

