当在tablelayout中显示图片时,设置imageView为固定大小时,会出现divide by zero 错误
将LayoutParams 改为 TableRow.LayoutParams即可
TableRow.LayoutParams params = new TableRow.LayoutParams(50, 50);//50 x 50
TableRow row = new TableRow(activity);
ImageView imgView = new ImageView(activity);
imgView.setLayoutParams(params);
imageLoader.displayImage(fileName, imgView, options);//显示图片
row.addView(imgView);
vh.imgLayout.addView(row);
mark~
时间: 2024-10-30 21:59:56