Android layout 无法检测.java文件中的错误
在下面的java文件中,我声明了imageview和TextViewAndroid layout 无法检测.java文件中的错误,android-layout,Android Layout,在下面的java文件中,我声明了imageview和TextView int numRow = 6; int numCol = 4; TableLayout tblLayout = (TableLayout)findViewById(R.id.tblLayout); for(int i = 0; i < numRow; i++) { HorizontalScrollView HSV = new Ho
int numRow = 6;
int numCol = 4;
TableLayout tblLayout = (TableLayout)findViewById(R.id.tblLayout);
for(int i = 0; i < numRow; i++) {
HorizontalScrollView HSV = new HorizontalScrollView(this);
HSV.setLayoutParams(new LayoutParams(LayoutParams.FILL_PARENT, LayoutParams.FILL_PARENT));
TableRow tblRow = new TableRow(this);
tblRow.setLayoutParams(new LayoutParams(LayoutParams.FILL_PARENT, LayoutParams.WRAP_CONTENT));
tblRow.setBackgroundResource(R.drawable.bookshelf);
// tblRow.setGravity(Gravity.CENTER | Gravity.BOTTOM);
for(int j = 0; j < numCol; j++) {
ImageView imageView = new ImageView(this);
imageView.setImageResource(R.drawable.icon);
imageView.setLayoutParams(new LayoutParams(LayoutParams.WRAP_CONTENT, LayoutParams.WRAP_CONTENT));
TextView textView = new TextView(this);
textView.setText("Java Tester");
textView.setLayoutParams(new LayoutParams(LayoutParams.WRAP_CONTENT, LayoutParams.WRAP_CONTENT));
// textView.setTextColor(Color.parseColor("#FFFFFF"));
//Sultan
tblRow.addView(imageView,j);
// tblRow.addView(textView,j);
}
HSV.addView(tblRow);
tblLayout.addView(HSV, i);
int numRow=6;
int numCol=4;
TableLayout tblLayout=(TableLayout)findviewbyd(R.id.tblLayout);
for(int i=0;i
但是文本视图的文本没有显示在屏幕上。问题是什么
我想在下面显示TextView的文本“Java Tester”。我可以为此做些什么?尝试取消注释//tblRow.addView(TextView,j);