ImageView的不可见 [英] ImageView is not visible
问题描述
我在的FrameLayout
两个的ImageView
项目: imageView1 的和的 imageView2 的。的 imageView1 的可见和 imageView2 的定位出屏幕的活动开始时。然后转动的FrameLayout
使用 RotateAnimation
这样的 imageView2 的应该变得可见,一些用户事件 imageView1 的应该走出画面。但是的 imageView2 的仍然是不可见的。有谁知道什么原因?
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?
在code是过大而复杂,在这里显示。但正如我在使用平移和旋转图像计算出的主要问题的 setImageMatrix 的功能和的FrameLayout
的特殊行为或的ImageView
,如果是他们的界限其中作物形象。
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.
推荐答案
如果我理解正确你的情况,那么你就错了。地方的FrameLayout它在堆栈中的孩子,并不是并列的。因此,他们不会呈现出来的画面,imageView2是后面imageView1。并表明它,你应该把它前面。
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.
我建议你看看ViewSwitcher / ViewAnimator布局。我认为他们会满足您的需求。
I would suggest you to look at ViewSwitcher/ViewAnimator layouts. I think they'll suit your needs.
这篇关于ImageView的不可见的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!