Hi, I am creating buttons dynamically by:
________________________ Button newVL = new Button(this); newVL.setId(zaehler); newVL.setText(mText); newVL.setWidth(280); newVL.setBackgroundDrawable(getResources().getDrawable (R.drawable.vlbg)); mStundenplan.addView(newVL); _________________________ How can I add marginTop and marginLeft to this button? I've tried: _________________________ LayoutParams lp = new LayoutParams(null); lp.topMargin = 10; lp.leftMargin = 20; newVL.setLayoutParams(lp); _________________________ but it doesnt work. Any ideas? Regards, Michael -- You received this message because you are subscribed to the Google Groups "Android Developers" group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en