Aside from the gravity discussion that has started, I'm not sure addContentView is what you want. I think the approach you are taking now is simply stacking the CheckBoxes on top of the LinearLayout...not putting them inside it. You say you already have a vertically oriented LinearLayout? Is it defined in a layout XML file you you are setting during onCreate? Grab the LinearLayout and use addView:
LinearLayout linearLayout = (LinearLayout)this.findViewById(R.id.yourLinearLayoutID); CheckBox box = new CheckBox(this); linearLayout.addView(box); CheckBox box2 = new CheckBox(this); linearLayout.addView(box2); (etc etc) On Sep 9, 2:42 pm, Bret Foreman <[email protected]> wrote: > I want to add some checkboxes to a LinearLayout at runtime. The > orientation is vertical and I want the checkboxes to appear at the > bottom. I create each checkbox like this: > > CheckBox box = new CheckBox(this); > > Then I add the box to the current view like this: > > addContentView( box , params ); > > What should be the params to get the effect I want? So far, everything > I've tried ends up overlaying the new checkboxes on top of each other > and on top of the other items in the layout. I want everything stacked > in a column with the new checkboxes at the bottom. -- 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

