如何解决ViewAnimationUtils(找不到符号)错误?

时间:2015-06-27 13:57:00

标签: java android android-animation

我在我的应用中使用动画有问题 这是我的代码:

int cx = (search.getLeft() + search.getRight()) / 2;
                int cy = (search.getTop() + search.getBottom()) / 2;

// get the initial radius for the clipping circle
                int initialRadius = search.getWidth();

// create the animation (the final radius is zero)
                Animator anim =
                              ViewAnimationUtils.createCircularReveal(search, cx, cy, initialRadius, 0);

// make the view invisible when the animation is done
                anim.addListener(new AnimatorListenerAdapter() {
                    @Override
                    public void onAnimationEnd(Animator animation) {
                        super.onAnimationEnd(animation);
                        search.setVisibility(View.INVISIBLE);
                    }
                });



当我想使用ViewAnimationUtils时,会出现包含此消息的错误:

cannot find symbol


而且当我想在我的项目中导入这个类时,我得到了同样的错误 有谁知道我怎么能摆脱这个消息并解决这个问题。我在我的应用程序中使用API​​ 21。
这是我的androidmanifest.xml代码的一部分:

<uses-sdk android:minSdkVersion="21"
        android:maxSdkVersion="21"
        android:targetSdkVersion="21"/>

1 个答案:

答案 0 :(得分:0)

我遇到了同样的问题并尝试了相同的修复,但只有当我检查我的项目的外部库时,才发现我没有“Android API 21平台”。

根据您的IDEA,您必须进入项目设置并将项目sdk更改为21.

相关问题