我想用动画替换片段,但每次都必须是动态的,即它将从我点击屏幕的点开始,但fragmentTransaction.setCustomAnimations
方法使用anim文件夹中定义的预定义动画,如下所示:
fragmentTransaction.setCustomAnimations(R.anim.bounce, R.anim.bounce);
我创建ScaleAnimation
了满足我需要的对象:
ScaleAnimation animation = new ScaleAnimation(fromX,ToX,fromY,toY,pivitX,pivotY); animation.setDuration(500);
fragmentTransaction.setCustomAnimations
方法不接受scaleAnimation
它只接受int.那么如何在替换片段时获得动态动画.