ImageViewをアニメーション化しようとしていますので、ゆっくりと左から右に表示されます。 ときI asked this before私は私が望んでいたかを説明するためにトラブルを抱えていたので、今回は私がHTML/JSを使用して所望の効果を作成しました:スケーリングせずにImageViewの幅をアニメ化する
のAndroidにこの効果を得るための最良の方法だろうか?
私はscaleTypeを変更し、そのImageViewのに直接ScaleAnimationを適用してみました:
レイアウト:
<ImageView
android:id="@+id/graphImage"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_alignParentTop="true"
android:scaleType="centerCrop"
android:background="@android:color/transparent"
android:contentDescription="@string/stroom_grafiek"
/>
のJava:
scale = new ScaleAnimation((float)0,
(float)1, (float)1, (float)1,
Animation.RELATIVE_TO_SELF, (float)0,
Animation.RELATIVE_TO_SELF, (float)1);
scale.setDuration(1000);
graphImage.startAnimation(scale);
をしかし、これはSTILスケール画像。
また、私はちょうどでframeLayoutをアニメーション可能性が期待して、でframeLayoutでImageViewのをラップ試してみました:
<FrameLayout
android:layout_width="70dp"
android:layout_height="fill_parent"
android:clipChildren="true"">
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="bottom|left|clip_horizontal" />
</FrameLayout>
これはまだでframeLayoutの内側に収まるように私のImageViewのを拡張しようとします。
多分Androidを使用してアニメーションがお手伝いしますか? –