Android 尝试设置ImageView的动画无效

Android 尝试设置ImageView的动画无效,android,animation,Android,Animation,用于在视图中从左上角到全屏进行缩放的动画文件 <?xml version="1.0" encoding="utf-8"?> <set xmlns:android="http://schemas.android.com/apk/res/android" > <scale android:duration="800" android:fromXScale=".1" android:fromYScale=".1" android:pivot

用于在视图中从左上角到全屏进行缩放的动画文件

<?xml version="1.0" encoding="utf-8"?>
<set xmlns:android="http://schemas.android.com/apk/res/android" >
<scale
    android:duration="800"
    android:fromXScale=".1"
    android:fromYScale=".1"
    android:pivotX="100%"
    android:pivotY="0%"
    android:toXScale="1.0"
    android:toYScale="1.0"/>
</set>
在我的脑海里

try {
    hintBitmap = BitmapFactory.decodeStream(this.getApplicationContext()                    .getAssets().open("logos/"+question.getShintFileName()));
    } catch (IOException e) {
    hintBitmap = null ;
    e.printStackTrace();

hintImage.setVisibility(View.VISIBLE) ;
hintImage.setImageBitmap(hintBitmap);
newHintAnimation.reset() ;
hintImage.startAnimation(newHintAnimation) ;
我的布局xml具有以下特性

<ImageView
    android:id="@+id/hintImage"
    android:layout_width="60dip"
    android:layout_height="60dip"
    android:layout_alignParentLeft="true"
    android:layout_below="@+id/question_header_layout"
    android:layout_marginLeft="10dip"
    android:layout_marginTop="10dip"
    android:visibility="visible" />

我检查过了,位图上没有空值。如果使用overridePendingTransition(R.anim.newhintzoomin,0)在活动中运行相同的代码;它可以工作。

请尝试这是:

Animation hyperspaceJumpAnimation = AnimationUtils.loadAnimation(this, R.anim.newhintzoomin);
hintImage.startAnimation(newHintAnimation);

让我知道它是否有效:)祝你好运

确切的错误是什么?动画没有开始?我想你只是在问这个问题时忘了在catch语句中加上},不是真的吗?否则,情况可能就是这样。。。因为您将hintImage设置为null或不执行任何操作。动画不会启动..最重要的是,知道如何调试:),谢谢。
Animation hyperspaceJumpAnimation = AnimationUtils.loadAnimation(this, R.anim.newhintzoomin);
hintImage.startAnimation(newHintAnimation);