title: android : set margin between buttons with LayoutParams
body: <p>I want to automatically generate buttons vertically with a bottom margin of 20px between buttons. I try to set margin with a LayoutParams object, without success.</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
  &lt;LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
      android:id="@+id/regions_search"
      android:layout_width="fill_parent"
      android:layout_height="fill_parent"
      android:layout_marginBottom="30dip"
      android:orientation="vertical" &gt;
  &lt;/LinearLayout&gt;
  
  
  
  @Override
  public void onCreate(Bundle savedInstanceState) {
  
      ...
  
      for (Region region : regionsList) {
  
          //create new button     
          Button button = new Button(mContext);
  
          //set infos
          int id = Integer.parseInt(Long.toString((Long) region.getId()));        button.setId(id);
          button.setText(region.getName() + "( " + region.getStores_nb() + " )");
  
          //Layoutparams setting
          FrameLayout.LayoutParams params = new FrameLayout.LayoutParams(LayoutParams.FILL_PARENT, LayoutParams.WRAP_CONTENT);
          params.setMargins(0, 0, 0, 20);
  
          button.setLayoutParams(params);
  
          myLinear.addView(button);
  
          }
  </code></pre>
  
  <p>As you can see on image, there is no space between images. Someone knows why ?
  Thank you !
  <img src="https://i.stack.imgur.com/091Lu.png" alt="enter image description here"></p>