我有一个包含在RelativeLayout中的imageview。当点击图像视图时,我用翻译动画为整个RelativeLayout设置动画,将其向下移动。clickable imageview location change with animation - android
当我再次单击图像视图(在它的新位置)时,应该将它移回,但它不会。但是,如果我点击imageview开始的位置,它会将整个“面板”移回。为什么imageview不随相关布局移动...至少在它的可点击性方面。实际的图像正在移动,但可点击的位置不是。
这里是我的布局XML:
<RelativeLayout
android:layout_alignParentTop="true"
android:layout_alignParentLeft="true"
android:layout_width="fill_parent"
android:layout_height="120px"
android:layout_marginTop="-106px"
android:id="@+id/chatbox"
android:visibility="invisible">
<TextView
android:layout_width="fill_parent"
android:layout_height="106px"
android:background="#000000"
android:id="@+id/chattext" />
<ImageView
android:layout_width="20px"
android:layout_height="14px"
android:id="@+id/chatbubble"
android:layout_below="@id/chattext"
android:src="@drawable/chatbubble" />
</RelativeLayout>
编辑:我要补充一点,我使用Animation.setFillAfter(真)在动画完成后举行的地方面板。
这就是我害怕。谢谢(你的)信息。 – Kyle 2010-08-31 14:40:30