when i use animation in Android,it clip my Imageview,how to solve it?

Viewed 9

i'm attemp to implement a animation,which is saw like below it can change picture automatically when turn upside down once

valueAnimator.addListener(new Animator.AnimatorListener() {
        @Override
        public void onAnimationStart(Animator animation, boolean isReverse) {
            setImageDrawable(getResources().getDrawable(R.drawable.pic_1));
        }


        @Override
        public void onAnimationRepeat(Animator animator) {

                mCurImgIndex ++;
                switch (mCurImgIndex % mImgCount){
                    case 0:
                        setImageDrawable(getResources().getDrawable(R.drawable.pic_1));
                        break;
                    case 1:
                        setImageDrawable(getResources().getDrawable(R.drawable.pic_2));
                        break;
                    case 2:
                        setImageDrawable(getResources().getDrawable(R.drawable.pic_3));
                        break;
                }

        }
    });

but the piture doesn't work as i want. it's cliped,can't see entirely. i guess it was i change my picture when it go down and the height of it is changed.but the ImageView force it to center. what should i do to solve the problem.

0 Answers
Related