私は以下の問題があります。ビューでは、アニメーション描画をImageViewに設定したいと考えています。レイアウトの幅と高さが "wrap_content"のときはうまく動作します。しかし、fill_parentに変更したり、余白/パディング属性をImageViewに追加したりすると、アニメーションを表示しているにもかかわらず、AnimationDrawableのサイズが他のサイズになり、画像ビューに合わなくなります。AnimationDrawableのスケーリングサイズ
ImageViewまたはこの問題の別のソリューションでAnimationDrawableを拡大/縮小する方法はありますか?私はそれが非常にシンプルかもしれないと思うが、私は何が間違っているのか分からない(おそらくビットマップのいくつかの問題?)。ここで
は私のコードは、(非常に簡単)です:
private void initAnimation(Bitmap bm) {
statusAnim.addFrame(new BitmapDrawable(bm), 300);
zoomedImage.setBackgroundDrawable(statusAnim);
}
@Override
public void onWindowFocusChanged(boolean hasFocus) {
if (hasFocus)
statusAnim.start();
else
statusAnim.stop();
}
そしてanimationdrawableのxml SRC:
<animation-list xmlns:android="http://schemas.android.com/apk/res/android"
android:oneshot="false" >
<item
android:drawable="@drawable/status_blank"
android:duration="300"/>
誰もがこの問題を解決する私を助けることができれば、それは素晴らしいことです。 )
あなたは解決策を得ましたか? –