最近几天,我计划编写一个指南动画,我使用viewpager
。但是在第二个寻呼机中,我使用了property Animation
,但它没有显示为我的图像。这是代码。
public class HabitFragmnet extends BaseFragment {
private ImageView first;
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
View rootView = inflater.inflate(R.layout.habit_layout, null);
first = (ImageView) rootView.findViewById(R.id.habit_button);
startAnimaton();
return rootView;
}
@Override
public void startAnimaton() {
ValueAnimator firetAnim = ObjectAnimator.ofFloat(first,"scale",0.0f,1.0f);
firetAnim.setDuration(1000);
first.setPivotX(first.getWidth());
first.setPivotY(first.getHeight());
first.invalidate();
firetAnim.setInterpolator(new CycleInterpolator(2));
AnimatorSet set = new AnimatorSet();
set.play(firetAnim);
set.start();
}
@Override
public void stopAnimation() {
}
谁可以给我一些解决方案?