Android 平移动画后触摸区域不移动
我使用TranslateAnimation从上到下滑动布局(具有不同的ImageView),但当它滑动时,其可触摸区域仍然保持在先前的位置,它不会随着ImageView向下移动,它在视觉上显示其Y轴从某个值移动,但它的可触摸区域仍在原来的位置 请帮我解决这个问题 我将其用于滑动动画:Android 平移动画后触摸区域不移动,android,android-layout,Android,Android Layout,我使用TranslateAnimation从上到下滑动布局(具有不同的ImageView),但当它滑动时,其可触摸区域仍然保持在先前的位置,它不会随着ImageView向下移动,它在视觉上显示其Y轴从某个值移动,但它的可触摸区域仍在原来的位置 请帮我解决这个问题 我将其用于滑动动画: TranslateAnimation t =new TranslateAnimation(0, 0,0,35); t.setDuration(200); t.setFillAfter(true); t.set
TranslateAnimation t =new TranslateAnimation(0, 0,0,35);
t.setDuration(200);
t.setFillAfter(true);
t.setInterpolator(new LinearInterpolator());
menuSlideBgId.startAnimation(t);
inFram.startAnimation(t);
这是我的文件
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:gravity="left|right"
android:orientation="vertical"
android:background="@drawable/bg_android"
>
<ImageView
android:id="@+id/imageView1"
android:layout_width="150dp"
android:layout_height="68dp"
android:layout_gravity="center"
android:layout_marginTop="15dp"
android:src="@drawable/thinknsay" />
<RelativeLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/rLay"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:orientation="vertical" >
<ImageView
android:id="@+id/menuSlideBg"
android:layout_width="339dp"
android:layout_marginLeft="130dp"
android:layout_marginTop="452dp"
android:layout_height="35dp"
android:src="@drawable/menu_slide3" />
<RelativeLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/slideNavLayout"
android:layout_width="match_parent"
android:layout_height="550dp" >
<ImageView
android:id="@+id/bubbleMenu"
android:layout_width="28dp"
android:layout_height="28dp"
android:layout_gravity="left"
android:layout_marginLeft="180dp"
android:layout_marginTop="455dp"
android:src="@drawable/buble_icon" />
<ImageView
android:id="@+id/shareMenuId"
android:layout_width="28dp"
android:layout_height="28dp"
android:layout_gravity="left"
android:layout_marginLeft="225dp"
android:layout_marginTop="455dp"
android:onClick="shareMenu"
android:src="@drawable/share_icon" />
</RelativeLayout>
</RelativeLayout>
</LinearLayout>
TranslateAnimation
只是随着时间的推移在不同的位置重新绘制视图,它实际上不会移动视图。您还需要更改其布局位置,可用于更改视图属性。帧动画如何,我有一组图像可以通过在res->anim中创建XML和写入来移动,但问题是相同的,可触摸区域仍然在同一位置,如何通过移动的可触摸区域实现帧动画?