TranslateAnimation结束后按钮不起作用

Max*_*ner 2 animation android

我想模拟一个幻灯片动画.想法是在按下按钮时使用id searchForm滑动并滑动tablelayout,这样我就可以使用额外的空间作为列表.我设法滑动searchForm和按钮,列表似乎是可见的但在此之后我无法点击按钮,这里是负责幻灯片动画的代码:

TranslateAnimation slide = new TranslateAnimation(0, 0, 0,
  -findViewById(R.id.searchForm).getHeight());
   slide.setDuration(500);
   slide.setFillAfter(true);
   findViewById(R.id.searchForm).startAnimation(slide);
   findViewById(R.id.listBut).startAnimation(slide);

adapterSearch.add(new NotificationEntry("","444/2010","TEste","Etapa de teste2","2010"));
Run Code Online (Sandbox Code Playgroud)

这是包含视图元素的xml:

<TableLayout android:id="@+id/search"
android:layout_width="fill_parent" 
android:layout_height="wrap_content"
android:layout_alignParentBottom="true" 
android:stretchColumns="1">
<TableLayout  android:id="@+id/searchForm"
    android:layout_width="fill_parent" 
 android:layout_height="wrap_content"
 android:layout_alignParentBottom="true" 
 android:stretchColumns="1">
 <TableRow android:paddingTop="5px">
  <TextView android:text="Nº Processo:" />
  <EditText android:id="@+id/processNr" />
 </TableRow>
 <View android:id="@+id/View01" 
  android:layout_width="wrap_content"
  android:background="#B5B5B5" 
  android:layout_height="1px"
  android:paddingBottom="2px">
 </View>
 <TableRow android:paddingTop="5px">
  <TextView android:text="Etapa:" />
  <EditText android:id="@+id/tasksearch" />
 </TableRow>
 <View android:id="@+id/View01" 
  android:layout_width="wrap_content"
  android:background="#B5B5B5" 
  android:layout_height="1px"
  android:paddingBottom="2px">
 </View>
 <TableRow android:paddingTop="5px">
  <TextView android:text="Data inicio:" 
   android:id="@+id/datepick" />
  <EditText android:id="@+id/datebegvalue" />
 </TableRow>
 <View android:id="@+id/View01" 
  android:layout_width="wrap_content"
  android:background="#B5B5B5" 
  android:layout_height="1px"
  android:paddingBottom="2px" 
  android:paddingTop="5px">
 </View>
 <TableRow android:paddingTop="5px">
  <TextView android:text="Data Fim:" 
   android:id="@+id/dateendpick" />
  <EditText android:id="@+id/dateendvalue" />
 </TableRow>
 <View android:id="@+id/View01" 
  android:layout_width="wrap_content"
  android:background="#B5B5B5" 
  android:layout_height="1px"
  android:paddingBottom="2px" 
  android:paddingTop="5px">
 </View>  
</TableLayout>
<TableLayout android:id="@+id/listBut">
 <TableRow android:paddingTop="5px">
   <Button android:id="@+id/send" 
    android:text="Procurar"
    android:layout_width="fill_parent" 
    android:layout_height="fill_parent" />
 </TableRow>
 <ListView android:id="@+id/processlistsearch"
  android:layout_width="fill_parent" 
  android:layout_height="fill_parent" />
</TableLayout>
Run Code Online (Sandbox Code Playgroud)

jam*_*mes 6

我相信动画的视图实际上并没有移动他们的x,y点,但你只是在视觉上通过动画看到他们的动作.观点实际上仍处于原始位置

看到我的问题

可能会GONE在动画结束的位置放置一个视图,并在动画结束时将可见性更改为VISIBLE.看起来好像它实际上移动了,并且对视图的任何操作(例如按钮上的单击事件)都可以用来做你想要的