I’m trying to overlay 2 ImageViews, one with the background and one with an animated (using AnimationDrawable). The animated frames are transparent PNGs.
The problem is that when both images visible, the overlaid animation does not show. If I add a JPG as one of the frames, only when that frames comes in line it is displayed so my presumption is there is something wrong with transparent images.
If I display only the animation without background image it show good.
This is part of the code:
AbsoluteLayout layout = new AbsoluteLayout(this);
setContentView(layout);
ImageView splash = new ImageView(this);
splash.setImageResource(R.drawable.splashscreen);
ImageView imageAnim = new ImageView(this);
animation = new AnimationDrawable();
imageAnim.post(new Starter());
imageAnim.setImageDrawable(animation);
layout.addView(splash, new AbsoluteLayout.LayoutParams(Global.Width, Global.Height, 0, 0));
layout.addView(imageAnim, new AbsoluteLayout.LayoutParams((int) (89 * Global.scaleX), (int) (68 * Global.scaleY), (int) (550 * Global.scaleX), (int) (413 * Global.scaleY)));
imageAnim.bringToFront();
Thank you
Have you tried setting the background of your AbsoluteLayout instead of using a ImageView for the background?
Thus instead of the code:
use this: