我是 Java 新手。我在包含myImageViews[0].v1 = new ImageView(context)
. 有什么问题吗?
class MyImageViews
{
ImageView v1;
ImageView v2;
}
MyImageViews[] myImageViews;
protected class MyLayout extends RelativeLayout {
public MyLayout(Context context) {
super(context);
myImageViews = new MyImageViews[10];
myImageViews[0].v1 = new ImageView(context); //runtime error at this line
}
}