2010-05-20 61 views
3

我在Button上添加動畫,使用.SetFillAfter(true)將最後一個視圖保留在屏幕上。但我發現不可能通過再次觸摸屏幕上的按鈕圖標來調用觸摸事件功能(但可以通過觸摸原始位置調用它)。動畫結束後無法激活查看觸摸事件

<?xml version="1.0" encoding="utf-8"?> 
<AbsoluteLayout xmlns:android="http://schemas.android.com/apk/res/android" 
    android:orientation="vertical" 
    android:layout_width="fill_parent" 
    android:layout_height="fill_parent" 
    > 
<Button 
    android:id ="@+id/button" 
    android:layout_width="wrap_content" 
    android:layout_height="wrap_content" 
    android:text="Move" 
    /> 
</AbsoluteLayout> 

anim = AnimationUtils.loadAnimation(this, R.anim.move); 
    anim.setInterpolator(this, android.R.anim.accelerate_decelerate_interpolator); 

回答

0

也在尋找解決這一問題。

@Ruivo - 通過源動畫的樣子,我發現這一點:

/** 
* Indicates whether or not this animation will affect the transformation 
* matrix. For instance, a fade animation will not affect the matrix whereas 
* a scale animation will.</p> 
* 
* @return true if this animation will change the transformation matrix 
*/ 
public boolean willChangeTransformationMatrix() { 
    // assume we will change the matrix 
    return true; 
} 

/** 
* <p>Indicates whether or not this animation will affect the bounds of the 
* animated view. For instance, a fade animation will not affect the bounds 
* whereas a 200% scale animation will.</p> 
* 
* @return true if this animation will change the view's bounds 
*/ 
public boolean willChangeBounds() { 
    // assume we will change the bounds 
    return true; 
} 

更新:我提供我自己回答這個問題。看到這個問題Android ScaleAnimation doesn't scale clickable area