1

我可以使用此代码动态更改图像:

public void changeImage()
    {
       Log.d("debug1", "" + getCurrentScene().getNumChildren());
        ArrayList<Object3D> objectList = getCurrentScene().getChildrenCopy();
        Material material = objectList.get(0).getMaterial();
        for (ATexture texture : material.getTextureList())
        {
            material.removeTexture(texture);
            texture = null;
        }

        Texture t = new Texture("sphereTexture",R.drawable.newImage);
        t.shouldRecycle(true);
              try {
                  material.addTexture(t);
              }
              catch (Exception e){e.printStackTrace();}

    }

现在我想用动画改变图像。请帮助如何为球体设置动画。

4

1 回答 1

0

尝试这个,

单击您的图像视图,添加动画。

Animation fadeIn = new AlphaAnimation(0, 1);
fadeIn.setInterpolator(new DecelerateInterpolator()); 
fadeIn.setDuration(500);

Image.setAnimation(fadeIn);
于 2015-11-16T07:13:42.417 回答