【发布时间】:2015-11-17 06:38:15
【问题描述】:
我正在使用以下代码,
<ImageView
android:id="@+id/imgView"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerInParent="true"
android:background="@drawable/animate"/>
我的 animate.xml 是,
<rotate xmlns:android="http://schemas.android.com/apk/res/android"
android:pivotX="50%"
android:pivotY="50%"
android:fromDegrees="90"
android:toDegrees="90"
android:repeatCount="infinite"
android:drawable="@drawable/cameras">
在java中启动它,
ImageView imgView=(ImageView)findViewById(R.id.imgView);
Animation rotation = AnimationUtils.loadAnimation(this, R.drawable.animate);
imgView.startAnimation(rotation);
但我的 ImageView 仍然没有旋转, 我见过很多例子,但没有一个是有效的。
【问题讨论】: