2013-10-07 112 views

回答

4

使用此代碼,並根據你的代碼

TableLayout table = new TableLayout(this); 
    for (int i = 0; i < mRows; i++) { 

     TableRow tr = new TableRow(mContext); 
     tr.setLayoutParams(new TableRow.LayoutParams(LayoutParams.FILL_PARENT, LayoutParams.WRAP_CONTENT)); 

     for (int j = 0; j < mCols; j++) { 

      ImageView view = new ImageView(this); 
      view.setImageResource(R.drawable.star_on) 
      tr.addView(view); 
     } 
     table.addView(tr); 
    } 
+0

尼斯進行更改。謝謝。 – RussVirtuoso

相關問題