title: View not showing in layout when layoutparams is set programatically
body: <p>Every time I set the layout param of TextView to wrap content or fill parent it's not showing in the view, but when I set it to pixels it's working why is that?</p>
  
  <p>Here is the relevant code:</p>
  
  <pre><code>items = (LinearLayout) findViewById(R.id.llmain);
          tb = new TableLayout(MainActivity.this);
  
          tb.setLayoutParams(new LayoutParams(LayoutParams.WRAP_CONTENT, LayoutParams.WRAP_CONTENT));
          tb.setGravity(Gravity.CENTER);
  
  
              TableRow tr = new TableRow(MainActivity.this);
              ImageButton ima = new ImageButton(MainActivity.this);
              ImageButton imr = new ImageButton(MainActivity.this);
              TextView tvin = new TextView(this);
  
              TableRow.LayoutParams trp = new TableRow.LayoutParams();
              trp.setMargins(0, 0, 0, 10);
              tr.setLayoutParams(trp);
              tr.setGravity(Gravity.CENTER);
  
              ima.setBackgroundColor(Color.TRANSPARENT);
              ima.setImageResource(R.drawable.add);
  
              imr.setBackgroundColor(Color.TRANSPARENT);
              imr.setImageResource(R.drawable.remove);
  
              tvin.setWidth(100);
              tvin.setHeight(45);
              tvin.setGravity(Gravity.CENTER);
              tvin.setText(sil[i]);
              tvin.setBackgroundColor(Color.rgb(200, 0, 255));
  
              tr.addView(ima);
              tr.addView(tvin);
              tr.addView(imr);
  
              tb.addView(tr);
  
          items.addView(tb);
  </code></pre>
  
  <p>I tried using this</p>
  
  <pre><code>tvin.setLayoutParams(new LayoutParams(
              LayoutParams.FILL_PARENT,
              LayoutParams.WRAP_CONTENT));
  </code></pre>
  
  <p>and this</p>
  
  <pre><code>tvin.setWidth(LayoutParams.FILL_PARENT);
  tvin.setHeight(LayoutParams.FILL_PARENT);
  </code></pre>
  
  <p>but none of these work.</p>