Guest User

Untitled

a guest
Aug 20th, 2018
84
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.71 KB | None | 0 0
  1. Multiple rows in table not showing
  2. public void onCreate(Bundle savedInstanceState) {
  3. super.onCreate(savedInstanceState);
  4. setContentView(R.layout.main);
  5. TextView tv = null;
  6.  
  7. while (i < 5) {
  8. TableRow trow = new TableRow(this);
  9.  
  10. while (j < 3) {
  11. tv = new TextView(this);
  12.  
  13. tv.setText(" " + j + i);
  14. tv.setTextColor(Color.BLACK);
  15. tv.setWidth(25);
  16. tv.setBackgroundColor(Color.WHITE);
  17.  
  18. trow.addView(tv);
  19. j++;
  20. }
  21. Log.i("SS", "adding row for " + i + " time");
  22. this.addContentView(trow, new LayoutParams(
  23. LayoutParams.WRAP_CONTENT, LayoutParams.WRAP_CONTENT));
  24.  
  25. i++;
  26. }
Add Comment
Please, Sign In to add comment