Dynamically add TableRow to TableLayout

后端 未结 1 561
余生分开走
余生分开走 2020-12-03 03:15

When a button is clicked, the following method is run:

public void createTableRow(View v) {
  TableLayout tl = (TableLayout) findViewById(R.id.spreadsheet);
         


        
相关标签:
1条回答
  • 2020-12-03 03:46

    As it turns out, Eclipse is not always right. Ctrl+Shift+M made the wrong import. It had import android.view.ViewGroup.LayoutParams when it should have import android.widget.TableRow.LayoutParams

    Everything works fine now.

    0 讨论(0)
提交回复
热议问题