0

I have two ImageView items in FrameLayout: imageView1 and imageView2. imageView1 is visible and imageView2 is positioned out of screen when activity starts. Then I rotate FrameLayout on some user event using RotateAnimation so imageView2 should become visible and imageView1 should go out of screen. But imageView2 still remains invisible. Does anyone know what's the reason?

The code is too large and complicated to show here. But as I have figured out the main problem in translating and rotating images using setImageMatrix function and special behavior of FrameLayout or ImageView, which crop image if it is out of their bounds.

Pavlo Viazovskyy
  • 927
  • 5
  • 12

2 Answers2

2

If I understood correctly your situation, then you are mistaken. FrameLayout places it's children in stack, not side by side. So they aren't rendered out of screen, imageView2 is right behind imageView1. And to show it, you should bring it to front.

I would suggest you to look at ViewSwitcher/ViewAnimator layouts. I think they'll suit your needs.

Alex Orlov
  • 18,077
  • 7
  • 55
  • 44
  • You need to call showNext(), showPrevious() fro those layouts. I'll be much easier if you will provide your xml layout – Alex Orlov Sep 21 '12 at 07:23
0

I've solved my problem. I've just change height in LayoutParams of FrameLayout from "fill_parent" to exact height, which allows to keep all ImageView's in FrameLayout.

Pavlo Viazovskyy
  • 927
  • 5
  • 12