ImageRenderer.java
public class ImageRenderer implements Renderer {
...
private Context mActivityContext;
...
public SandAniRenderer(final Context activityContext) {
// TODO Auto-generated constructor stub
mActivityContext = activityContext;
mField = new Field(mActivityContext);
...
}
private boolean InitializeObject(int width, int height)
{
...
Field.SetField(width, height, R.drawable.image);
...
return true;
}
字段.java
public class Field extends xxx{
private final Context mActivityContext;
public Field(Context activityContext)
{
mActivityContext = activityContext;
}
public boolean SetField(int width, int height, int fn)
{
ImageView mImage = (ImageView) ((Activity) mActivityContext).findViewById(fn);
...
}
但它不起作用!
mImage 包含空图像...
我找不到图像如何包含在活动之外。
您能帮我了解如何在活动之外实现绘制 ImageView 吗?