有 Java 编程相关的问题?

你可以在下面搜索框中键入要查询的问题!

java动画无法按顺序工作

您好,我正在开发一个应用程序,我使用不同的动画,但我的问题是动画是并行执行,而不是一个接一个。 为了解决这个问题,我使用了动画集,但问题仍然是一样的。 我不明白我错在哪里。 如果您有任何帮助,我们将不胜感激。谢谢 我的代码

@Override
    public View onCreateView(LayoutInflater inflater, ViewGroup container,
                             Bundle savedInstanceState) {
        // Inflate the layout for this fragment
        View view= inflater.inflate(R.layout.fragment_profile, container, false);
        AnimationSet animationSet = new AnimationSet(true);
        Animation animFadeIn = AnimationUtils.loadAnimation(getActivity(), R.anim.fade_in);
        Animation expandIn = AnimationUtils.loadAnimation(getActivity(), R.anim.image_popup);
        Animation slideIn = AnimationUtils.loadAnimation(getActivity(),R.anim.slide_in_down);
        background_image = (RelativeLayout)view.findViewById(R.id.background_image);
        background_image.startAnimation(slideIn);
        circleImageView = (CircleImageView)view.findViewById(R.id.circle_image);
        circleImageView.startAnimation(expandIn);
        profile_recyclerview.clearAnimation();
        profile_recyclerview.startAnimation(animFadeIn);
        animationSet.addAnimation(slideIn);
        animationSet.addAnimation(expandIn);
        animationSet.addAnimation(animFadeIn);
        animFadeIn.reset();

共 (1) 个答案