posted by Full-stack Developer 2011. 5. 27. 16:03

ListView contents = new ListView(ctx);
  LinearLayout.LayoutParams lp=new LinearLayout.LayoutParams(300, LayoutParams.FILL_PARENT);
  lp.setMargins(2, 50, 0, 2);
  contents.setLayoutParams(lp);
  contents.setDivider(new ColorDrawable(Color.GRAY));
  contents.setDividerHeight(1);