我有一个包含在RelativeLayout中的imageview.单击图像视图时,我使用平移动画为整个RelativeLayout设置动画以将其向下移动.
当我再次点击图像视图(在它的新位置)时,它应该将其向上移动,但事实并非如此.但是,如果我单击imageview开始的位置,它会将整个“面板”移回.为什么imageview不会随相对布局移动…至少就其可点击性而言.实际图像正在移动,但可点击的位置不是.
这是我的布局的xml:
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">
android:layout_width="fill_parent"
android:layout_height="106px"
android:background="#000000"
android:id="@+id/chattext" />
android:layout_width="20px"
android:layout_height="14px"
android:id="@+id/chatbubble"
android:layout_below="@id/chattext"
android:src="@drawable/chatbubble" />
编辑:我应该添加我正在使用Animation.setFillAfter(true)在动画完成后将面板保持在原位.