title: how to set View height in tablelayout in android?
body: <p>I have a problem i want to set View in table layout and manage the height but i am not able to set the height. it is taking bydefault height.</p>
  
  <p>Note:- view is in red color</p>
  
  <p>please give me any idea for this.</p>
  
  <p>/* this is my code */</p>
  
  <p>tableLayout.addView(tableRow);</p>
  
  <pre><code>    View lineview = new View(this); 
    lineview.setLayoutParams(new TableLayout.LayoutParams(LayoutParams.WRAP_CONTENT, LayoutParams.WRAP_CONTENT, 1f));
  
      //lineview.setPadding(0, 1, 0, 0);
  
      //lineview.setMinimumHeight(1);
  
      lineview.setBackgroundResource(R.drawable.red);
      tableLayout.addView(lineview);
  
      final ViewGroup.MarginLayoutParams lpt =(MarginLayoutParams)lineview.getLayoutParams();
      lpt.setMargins(lpt.leftMargin,lpt.topMargin,lpt.rightMargin,lpt.bottomMargin=2);
  </code></pre>
  
  <p>/* and this is my layout */</p>
  
  <p><img src="https://i.stack.imgur.com/JA7QW.png" alt="enter image description here"></p>
  
  <p>"Thanks"</p>