I'm running this code and the emulator is posting a force quit. Does anyone know what could be wrong?
TableLayout tl = (TableLayout)findViewById(R.id.tableLayout1);
TableRow tr = new TableRow(this);
tr.setLayoutParams(new LayoutParams(LayoutParams.FILL_PARENT, LayoutParams.WRAP_CONTENT));
ImageView IV = new ImageView(this);
IV.setBackgroundResource(R.drawable.celtics);
IV.setLayoutParams(new LayoutParams(Lay开发者_JS百科outParams.FILL_PARENT,LayoutParams.WRAP_CONTENT));
tr.addView(IV);
tl.addView(tr);
I actually found a way to get around this by doing this dynamically. I deleted the xml file and created the table in Java
精彩评论